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