mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Note that this *trivially* updates project urls by adding the NPM url to the end, even when the urls are almost identical or the DT one is outdated. I'll clean up the urls in a later commit. This PR is unfinished! Please do not merge it yet.
47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
// Type definitions for commonjs-assert 1.4
|
|
// Project: https://github.com/browserify/commonjs-assert, https://github.com/defunctzombie/commonjs-assert
|
|
// Definitions by: Nico Gallinal <https://github.com/nicoabie>
|
|
// Linus Unnebäck <https://github.com/LinusU>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare function assert(value: any, message?: string): void;
|
|
|
|
declare namespace assert {
|
|
function fail(actual?: any, expected?: any, message?: string, operator?: string): void;
|
|
|
|
function ok(value: any, message?: string): void;
|
|
|
|
function equal(actual: any, expected: any, message?: string): void;
|
|
|
|
function notEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function deepEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
|
|
|
function strictEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function notStrictEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function throws(block: () => void, message?: string): void;
|
|
function throws(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
|
|
|
|
function doesNotThrow(block: () => void, message?: string): void;
|
|
function doesNotThrow(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
|
|
|
|
function ifError(value: any): void;
|
|
|
|
class AssertionError implements Error {
|
|
name: string;
|
|
message: string;
|
|
actual: any;
|
|
expected: any;
|
|
operator: string;
|
|
generatedMessage: boolean;
|
|
|
|
constructor(options?: { message?: string; actual?: any; expected?: any; operator?: string; stackStartFunction?: () => void });
|
|
}
|
|
}
|
|
|
|
export = assert;
|