-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathnodeunit.d.ts
46 lines (40 loc) · 1.78 KB
/
nodeunit.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
declare module nodeunit {
export class Test {
done(err?: any): void;
expect(num: number): void;
//assersions from node assert module
fail(actual: any, expected: any, message: string, operator: string): void;
assert(value: any, message: string): void;
ok(value: any, message?: string): void;
equal(actual: any, expected: any, message?: string): void;
notEqual(actual: any, expected: any, message?: string): void;
deepEqual(actual: any, expected: any, message?: string): void;
notDeepEqual(acutal: any, expected: any, message?: string): void;
strictEqual(actual: any, expected: any, message?: string): void;
notStrictEqual(actual: any, expected: any, message?: string): void;
throws(block: any, error?: any, messsage?: string): void;
doesNotThrow(block: any, error?: any, messsage?: string): void;
ifError(value: any): void;
//assertion wrappers
equals(actual: any, expected: any, message?: string): void;
same(actual: any, expected: any, message?: string): void;
}
// Test Group Usage:
// var testGroup: nodeunit.ITestGroup = {
// setUp: function (callback: nodeunit.ICallbackFunction): void {
// callback();
// },
// tearDown: function (callback: nodeunit.ICallbackFunction): void {
// callback();
// },
// test1: function (test: nodeunit.Test): void {
// test.done();
// }
// }
// exports.testgroup = testGroup;
export interface ITestGroup {
setUp?: (callback: ICallbackFunction) => void;
tearDown?: (callback: ICallbackFunction) => void;
}
export interface ICallbackFunction { (err?: any): void; }
}