1 | export function script(options?: ScriptOptions): Script;
|
2 |
|
3 | export const assertions: any;
|
4 |
|
5 | interface Script {
|
6 | after: After;
|
7 | afterEach: After;
|
8 | before: Before;
|
9 | beforeEach: Before;
|
10 | describe: Experiment;
|
11 | experiment: Experiment;
|
12 | suite: Experiment;
|
13 | it: Test;
|
14 | test: Test;
|
15 | expect(value: any): any;
|
16 | }
|
17 |
|
18 | interface Options {
|
19 |
|
20 | timeout?: number;
|
21 | }
|
22 |
|
23 | interface Plan {
|
24 |
|
25 | plan?: number;
|
26 | }
|
27 |
|
28 | interface OperationFlags {
|
29 | context: Record<string, any>;
|
30 | }
|
31 |
|
32 | interface Operation {
|
33 | <T>(flags: OperationFlags): Promise<T> | void;
|
34 | (flags: OperationFlags): void;
|
35 | }
|
36 |
|
37 | interface Flags extends OperationFlags {
|
38 | note(note: string): void;
|
39 | onCleanup(operation: Operation): void;
|
40 | onUnhandledRejection(err: Error): void;
|
41 | onUncaughtException(err: Error): void;
|
42 | }
|
43 |
|
44 | interface After {
|
45 | (operation: Operation): void;
|
46 | (options: Options, operation: Operation): void;
|
47 | }
|
48 |
|
49 | interface Before extends After {}
|
50 |
|
51 | interface ScriptOptions {
|
52 |
|
53 | schedule?: boolean;
|
54 | cli?: any;
|
55 | }
|
56 |
|
57 | interface ExperimentOptions extends Options {
|
58 |
|
59 | skip?: boolean;
|
60 |
|
61 | only?: boolean;
|
62 | }
|
63 |
|
64 | interface TestOptionsOnlySkip extends Options, Plan {}
|
65 |
|
66 | interface TestOptions extends ExperimentOptions, Plan {}
|
67 |
|
68 | interface TestFunction {
|
69 | <T>(flags: Flags): Promise<T> | void;
|
70 | (flags: Flags): void;
|
71 | }
|
72 |
|
73 | interface Test {
|
74 | (title: String, test: TestFunction): void;
|
75 | (title: String, options: TestOptions, test: TestFunction): void;
|
76 |
|
77 | only(title: String, test: TestFunction): void;
|
78 | only(title: String, options: TestOptionsOnlySkip, test: TestFunction): void;
|
79 |
|
80 | skip(title: String, test: TestFunction): void;
|
81 | skip(title: String, options: TestOptionsOnlySkip, test: TestFunction): void;
|
82 | }
|
83 |
|
84 | interface ExperimentFunction {
|
85 | (title: String, experiment: () => void): void;
|
86 | (title: String, options: ExperimentOptions, experiment: () => void): void;
|
87 | }
|
88 |
|
89 | interface Experiment extends ExperimentFunction {
|
90 |
|
91 | only: ExperimentFunction;
|
92 |
|
93 | skip: ExperimentFunction;
|
94 | }
|