1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | declare function assert(value: any, message?: string): asserts value;
|
9 |
|
10 | declare namespace assert {
|
11 | function fail(actual?: any, expected?: any, message?: string, operator?: string): never;
|
12 |
|
13 | function ok(value: any, message?: string): asserts value;
|
14 |
|
15 |
|
16 | function equal(actual: any, expected: any, message?: string): void;
|
17 |
|
18 |
|
19 | function notEqual(actual: any, expected: any, message?: string): void;
|
20 |
|
21 |
|
22 | function deepEqual(actual: any, expected: any, message?: string): void;
|
23 |
|
24 |
|
25 | function notDeepEqual(actual: any, expected: any, message?: string): void;
|
26 |
|
27 | function deepStrictEqual<T>(actual: any, expected: T, message?: string): asserts actual is T;
|
28 |
|
29 | function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
30 |
|
31 | function strictEqual<T>(actual: any, expected: T, message?: string): asserts actual is T;
|
32 |
|
33 | function notStrictEqual(actual: any, expected: any, message?: string): void;
|
34 |
|
35 | function throws(block: () => void, message?: string): void;
|
36 | function throws(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
|
37 |
|
38 | function doesNotThrow(block: () => void, message?: string): void;
|
39 | function doesNotThrow(
|
40 | block: () => void,
|
41 | error: (() => void) | ((err: any) => boolean) | RegExp,
|
42 | message?: string,
|
43 | ): void;
|
44 |
|
45 | function ifError(value: any): asserts value is null | undefined;
|
46 |
|
47 | class AssertionError implements Error {
|
48 | name: string;
|
49 | message: string;
|
50 | actual: any;
|
51 | expected: any;
|
52 | operator: string;
|
53 | generatedMessage: boolean;
|
54 |
|
55 | constructor(options?: {
|
56 | message?: string;
|
57 | actual?: any;
|
58 | expected?: any;
|
59 | operator?: string;
|
60 | stackStartFunction?: () => void;
|
61 | });
|
62 | }
|
63 |
|
64 | const strict: typeof assert;
|
65 | }
|
66 |
|
67 | export = assert;
|