forked from dead-claudia/thallium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
internal.d.ts
108 lines (88 loc) · 3.3 KB
/
internal.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import {
Test, Location,
StartReport, EnterReport, LeaveReport, PassReport,
FailReport, SkipReport, EndReport, ErrorReport, HookReport,
BeforeAllReport, BeforeEachReport, AfterEachReport, AfterAllReport,
HookStage, HookError,
} from "./index";
/**
* Create a new Thallium instance.
*/
export function root(): Test;
export namespace reports {
/**
* Create a `start` report. Mostly useful for testing reporters.
*/
export function start(): StartReport;
/**
* Create a `enter` report. Mostly useful for testing reporters.
*/
export function enter(path: Location[], duration?: number, slow?: number): EnterReport;
/**
* Create a `leave` report. Mostly useful for testing reporters.
*/
export function leave(path: Location[]): LeaveReport;
/**
* Create a `pass` report. Mostly useful for testing reporters.
*/
export function pass(path: Location[], duration?: number, slow?: number): PassReport;
/**
* Create a `fail` report. Mostly useful for testing reporters.
*/
export function fail(path: Location[], error: any, duration?: number, slow?: number): FailReport;
/**
* Create a `skip` report. Mostly useful for testing reporters.
*/
export function skip(path: Location[]): SkipReport;
/**
* Create a `end` report. Mostly useful for testing reporters.
*/
export function end(): EndReport;
/**
* Create a `error` report. Mostly useful for testing reporters.
*/
export function error(error: any): EndReport;
/**
* Create a `hook` report. Mostly useful for testing reporters.
*/
export function hook(path: Location[], hookError: HookError<HookStage>): HookReport;
/**
* Create a `hook` report. Mostly useful for testing reporters.
*/
export function hook(path: Location[], hookError: HookError<"before all">): BeforeAllReport;
/**
* Create a `hook` report. Mostly useful for testing reporters.
*/
export function hook(path: Location[], hookError: HookError<"before each">): BeforeEachReport;
/**
* Create a `hook` report. Mostly useful for testing reporters.
*/
export function hook(path: Location[], hookError: HookError<"after each">): AfterEachReport;
/**
* Create a `hook` report. Mostly useful for testing reporters.
*/
export function hook(path: Location[], hookError: HookError<"after all">): AfterAllReport;
}
type Hook = (...args: any[]) => any;
export namespace hookErrors {
/**
* Create a new `before all` hook error, mainly for testing reporters.
*/
export function beforeAll(func: Hook, error: any): HookError<"before all">;
/**
* Create a new `before each` hook error, mainly for testing reporters.
*/
export function beforeEach(func: Hook, error: any): HookError<"before each">;
/**
* Create a new `after each` hook error, mainly for testing reporters.
*/
export function afterEach(func: Hook, error: any): HookError<"after each">;
/**
* Create a new `after all` hook error, mainly for testing reporters.
*/
export function afterAll(func: Hook, error: any): HookError<"after all">;
}
/**
* Create a location data object. Mostly useful for testing reporters.
*/
export function location(name: string, index: number): Location;