forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
power-assert.d.ts
66 lines (48 loc) · 2.26 KB
/
power-assert.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Type definitions for power-assert
// Project: https://github.com/twada/power-assert
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// copy from assert external module in node.d.ts
/// <reference path="../empower/empower.d.ts" />
/// <reference path="../power-assert-formatter/power-assert-formatter.d.ts" />
declare function assert(value:any, message?:string):void;
declare namespace assert {
export 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?: Function});
}
export function fail(actual?:any, expected?:any, message?:string, operator?:string):void;
export function ok(value:any, message?:string):void;
export function equal(actual:any, expected:any, message?:string):void;
export function notEqual(actual:any, expected:any, message?:string):void;
export function deepEqual(actual:any, expected:any, message?:string):void;
export function notDeepEqual(acutal:any, expected:any, message?:string):void;
export function strictEqual(actual:any, expected:any, message?:string):void;
export function notStrictEqual(actual:any, expected:any, message?:string):void;
export var throws:{
(block:Function, message?:string): void;
(block:Function, error:Function, message?:string): void;
(block:Function, error:RegExp, message?:string): void;
(block:Function, error:(err:any) => boolean, message?:string): void;
};
export var doesNotThrow:{
(block:Function, message?:string): void;
(block:Function, error:Function, message?:string): void;
(block:Function, error:RegExp, message?:string): void;
(block:Function, error:(err:any) => boolean, message?:string): void;
};
export function ifError(value:any):void;
export interface Options {
assertion?: empower.Options;
output?: powerAssertFormatter.Options;
}
export function customize(options:Options):typeof assert;
}
declare module "power-assert" {
export default assert;
}