mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* [assert] Add notDeepStrictEqual * [assert] Deprecate non-strict functions * [assert] Add asserts _ is _ annotations * [asenv] Remove dependency on assert * [bintrees] Remove dependency on assert * [bookshelf] Remove dependency on assert * [bser] Remove dependency on assert * [cbor] Remove dependency on assert * [express-handlebars] Remove dependency on assert * [fbemitter] Remove dependency on assert * [hapi v16] Remove dependency on assert * [libpq] Remove dependency on assert * [memcached] Remove dependency on assert * [multireducer] Remove dependency on assert * [oracledb] Remove dependency on assert * [pako] Remove dependency on assert * [pigpio] Remove dependency on assert * [project-oxford] Remove dependency on assert * [range_check] Remove dependency on assert * [rgrove__parse-xml] Remove dependency on assert * [sanctuary] Remove dependency on assert * [seed-random] Remove dependency on assert * [set-cookie-parser] Remove dependency on assert * [sort-object-keys] Remove dependency on assert * [superagent] Remove dependency on assert * [whatwg-mimetype] Remove dependency on assert * [xmlpoke] Remove dependency on assert * [yadda] Remove dependency on assert * [oracledb] avoid using includes in tests
56 lines
2.3 KiB
TypeScript
56 lines
2.3 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
|
|
// TypeScript Version: 3.7
|
|
|
|
declare function assert(value: any, message?: string): asserts value;
|
|
|
|
declare namespace assert {
|
|
function fail(actual?: any, expected?: any, message?: string, operator?: string): void;
|
|
|
|
function ok(value: any, message?: string): asserts value;
|
|
|
|
/** @deprecated Use `strictEqual` instead */
|
|
function equal(actual: any, expected: any, message?: string): void;
|
|
|
|
/** @deprecated Use `notStrictEqual` instead */
|
|
function notEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
/** @deprecated Use `deepStrictEqual` instead */
|
|
function deepEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
/** @deprecated Use `notDeepStrictEqual` instead */
|
|
function notDeepEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function deepStrictEqual<T>(actual: any, expected: T, message?: string): asserts actual is T;
|
|
|
|
function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
|
|
|
function strictEqual<T>(actual: any, expected: T, message?: string): asserts actual is T;
|
|
|
|
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): asserts value is null | undefined;
|
|
|
|
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;
|