1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export function script(options?: ScriptOptions): Lab & ExperimentAlt & TestAlt;
|
8 |
|
9 | export const assertions: any;
|
10 |
|
11 | interface Lab {
|
12 |
|
13 | experiment(desc: string, cb: EmptyCallback): void;
|
14 |
|
15 |
|
16 | experiment(desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
|
17 |
|
18 |
|
19 | describe(desc: string, cb: EmptyCallback): void;
|
20 |
|
21 |
|
22 | describe(desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
|
23 |
|
24 |
|
25 | suite(desc: string, cb: EmptyCallback): void;
|
26 |
|
27 |
|
28 | suite(desc: string, options: ExperimentOptions, cb: EmptyCallback): void;
|
29 |
|
30 |
|
31 | test(desc: string, cb: TestCallback): void;
|
32 |
|
33 |
|
34 | test(desc: string, promise: TestPromise): void;
|
35 |
|
36 |
|
37 | test(desc: string, options: TestOptions, cb: TestCallback): void;
|
38 |
|
39 |
|
40 | test(desc: string, options: TestOptions, promise: TestPromise): void;
|
41 |
|
42 |
|
43 | it(desc: string, cb: TestCallback): void;
|
44 |
|
45 |
|
46 | it(desc: string, promise: TestPromise): void;
|
47 |
|
48 |
|
49 | it(desc: string, options: TestOptions, cb: TestCallback): void;
|
50 |
|
51 |
|
52 | it(desc: string, options: TestOptions, promise: TestPromise): void;
|
53 |
|
54 |
|
55 | before(cb: AsyncCallback): void;
|
56 |
|
57 |
|
58 | before(promise: AsyncPromise): void;
|
59 |
|
60 |
|
61 | before(options: AsyncOptions, cb: AsyncCallback): void;
|
62 |
|
63 |
|
64 | before(options: AsyncOptions, promise: AsyncPromise): void;
|
65 |
|
66 |
|
67 | beforeEach(cb: AsyncCallback): void;
|
68 |
|
69 |
|
70 | beforeEach(promise: AsyncPromise): void;
|
71 |
|
72 |
|
73 | beforeEach(options: AsyncOptions, cb: AsyncCallback): void;
|
74 |
|
75 |
|
76 | beforeEach(options: AsyncOptions, promise: AsyncPromise): void;
|
77 |
|
78 |
|
79 | after(cb: AsyncCallback): void;
|
80 |
|
81 |
|
82 | after(promise: AsyncPromise): void;
|
83 |
|
84 |
|
85 | after(options: AsyncOptions, cb: AsyncCallback): void;
|
86 |
|
87 |
|
88 | after(options: AsyncOptions, promise: AsyncPromise): void;
|
89 |
|
90 |
|
91 | afterEach(cb: AsyncCallback): void;
|
92 |
|
93 |
|
94 | afterEach(promise: AsyncPromise): void;
|
95 |
|
96 |
|
97 | afterEach(options: AsyncOptions, cb: AsyncCallback): void;
|
98 |
|
99 |
|
100 | afterEach(options: AsyncOptions, promise: AsyncPromise): void;
|
101 | }
|
102 |
|
103 | interface ExperimentAlt {
|
104 | experiment: SkipOnlyExperiment;
|
105 | suite: SkipOnlyExperiment;
|
106 | describe: SkipOnlyExperiment;
|
107 | }
|
108 |
|
109 | interface TestAlt {
|
110 | test: SkipOnlyTest;
|
111 | it: SkipOnlyTest;
|
112 | }
|
113 |
|
114 | interface SkipOnlyExperiment {
|
115 |
|
116 | skip: ExperimentArgs & ExperimentWithOptionsArgs;
|
117 |
|
118 |
|
119 | only: ExperimentArgs & ExperimentWithOptionsArgs;
|
120 | }
|
121 |
|
122 | interface SkipOnlyTest {
|
123 |
|
124 | skip: TestArgs & TestWithOptionsArgs;
|
125 |
|
126 |
|
127 | only: TestArgs & TestWithOptionsArgs;
|
128 | }
|
129 |
|
130 | interface ScriptOptions {
|
131 |
|
132 | schedule?: boolean | undefined;
|
133 |
|
134 |
|
135 | cli?: any;
|
136 | }
|
137 |
|
138 | interface ExperimentOptions {
|
139 |
|
140 | timeout?: number | undefined;
|
141 |
|
142 |
|
143 | parallel?: boolean | undefined;
|
144 |
|
145 |
|
146 | skip?: boolean | undefined;
|
147 |
|
148 |
|
149 | only?: boolean | undefined;
|
150 | }
|
151 |
|
152 | interface TestOptions extends ExperimentOptions {
|
153 |
|
154 | plan?: number | undefined;
|
155 | }
|
156 |
|
157 | interface AsyncOptions {
|
158 |
|
159 | timeout?: number | undefined;
|
160 | }
|
161 |
|
162 | interface DoneNote {
|
163 |
|
164 | note: (text: string) => void;
|
165 | }
|
166 |
|
167 | type EmptyCallback = () => void;
|
168 |
|
169 | type DoneFunction = (err?: Error) => void;
|
170 |
|
171 | type CleanupFunction = (func: (next: Function) => void) => void;
|
172 |
|
173 | type TestCallback = (done: DoneFunction & DoneNote, onCleanup?: CleanupFunction) => void;
|
174 |
|
175 | type TestPromise = () => Promise<any>;
|
176 |
|
177 | type AsyncCallback = (done: DoneFunction) => void;
|
178 |
|
179 | type AsyncPromise = () => Promise<any>;
|
180 |
|
181 | type ExperimentArgs = (desc: string, cb: EmptyCallback) => {};
|
182 |
|
183 | type ExperimentWithOptionsArgs = (desc: string, options: ExperimentOptions, cb: EmptyCallback) => {};
|
184 |
|
185 | type TestArgs = (desc: string, cb: TestCallback) => {};
|
186 |
|
187 | type TestWithOptionsArgs = (desc: string, options: TestOptions, cb: TestCallback) => {}
|