forked from muonjs/mocha-suit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
78 lines (64 loc) · 2.05 KB
/
index.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
67
68
69
70
71
72
73
74
75
76
77
78
// Type definitions for [email protected]
// Project: Mocha Suit
// Definitions by: Sukharev Kirill <[email protected]>
declare type Suit = { [key:string]: any } & { [key:number]: any };
declare type TestSet = { testSet: boolean; } & { [key:string]: Suit; }
declare interface ExtendMethod {
(description: string, ctx: Suit, cb?: (this: MochaSuitFactory) => void): MochaSuitFactory
(description: string, cb?: (this: MochaSuitFactory) => void): MochaSuitFactory
}
declare interface CallBack {
(this: MochaSuitFactory, done?: (err?: any) => void): Promise<void> | void;
}
declare interface SetupMethod {
(cb: CallBack): MochaSuitFactory;
(suit: MochaSuitFactory) : MochaSuitFactory;
}
declare interface TeardownMethod {
(cb: CallBack) : MochaSuitFactory;
(suit: MochaSuitFactory) : MochaSuitFactory;
}
declare interface TestMethod {
(caseDescription: string, cb: CallBack) : MochaSuitFactory;
(suit: MochaSuitFactory) : MochaSuitFactory;
}
declare interface WithMethod {
(suit: MochaSuitFactory) : MochaSuitFactory;
}
declare interface ReplaceMethod {
(oldSuit: MochaSuitFactory, newSuit: MochaSuitFactory) : MochaSuitFactory;
}
declare interface SetMethod {
(suit: MochaSuitFactory, cb: CallBack) : MochaSuitFactory;
}
declare class MochaSuitFactory {
constructor()
suit: Suit
}
declare interface MochaSuitFactory {
(): void;
(testSet: TestSet): void;
(suits: Suit[]): void;
(suit: Suit): void;
extend: ExtendMethod;
before: SetupMethod;
beforeAll: SetupMethod;
beforeEach: SetupMethod;
after: TeardownMethod;
afterAll: TeardownMethod;
afterEach: TeardownMethod;
it: TestMethod;
xit: TestMethod;
that: TestMethod;
xthat: TestMethod;
only: TestMethod;
with: WithMethod;
replaceWith: ReplaceMethod;
setBefore: SetMethod;
setAfter: SetMethod;
setBeforeAll: SetMethod;
setAfterAll: SetMethod;
[key:string]: MochaSuitFactory | Function | Suit
}
declare function MochaSuitModule(name?: string): MochaSuitFactory;
export = MochaSuitModule;