Completed
Push — master ( 8d09a6...0dd02f )
by Dimas
31:45 queued 17:08
created

libs/typings/node/assert.d.ts   A

Complexity

Total Complexity 23
Complexity/F 1

Size

Lines of Code 58
Function Count 23

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 53
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 23
mnd 0
bc 0
fnc 23
bpm 0
cpm 1
noi 0
1
declare module "assert" {
2
    function assert(value: any, message?: string | Error): void;
3
    namespace assert {
4
        class AssertionError implements Error {
5
            name: string;
6
            message: string;
7
            actual: any;
8
            expected: any;
9
            operator: string;
10
            generatedMessage: boolean;
11
            code: 'ERR_ASSERTION';
12
13
            constructor(options?: {
14
                message?: string; actual?: any; expected?: any;
15
                operator?: string; stackStartFn?: Function
16
            });
17
        }
18
19
        type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
20
21
        function fail(message?: string | Error): never;
22
        /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
23
        function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
24
        function ok(value: any, message?: string | Error): void;
25
        /** @deprecated since v9.9.0 - use strictEqual() instead. */
26
        function equal(actual: any, expected: any, message?: string | Error): void;
27
        /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
28
        function notEqual(actual: any, expected: any, message?: string | Error): void;
29
        /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
30
        function deepEqual(actual: any, expected: any, message?: string | Error): void;
31
        /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
32
        function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
33
        function strictEqual(actual: any, expected: any, message?: string | Error): void;
34
        function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
35
        function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
36
        function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
37
38
        function throws(block: () => any, message?: string | Error): void;
39
        function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
40
        function doesNotThrow(block: () => any, message?: string | Error): void;
41
        function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
42
43
        function ifError(value: any): void;
44
45
        function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
46
        function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
47
        function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
48
        function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
49
50
        function match(value: string, regExp: RegExp, message?: string | Error): void;
51
        function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
52
53
        const strict: typeof assert;
54
    }
55
56
    export = assert;
57
}
58