1 |
|
2 |
|
3 |
|
4 | import { ITestOptions, ITestReport, ICallback, IResolver } from '../Contracts';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class Test<T extends any[]> {
|
14 | title: string;
|
15 | private _resolveFn;
|
16 | private _callback;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | private _todo;
|
22 | |
23 |
|
24 |
|
25 | private _regression;
|
26 | |
27 |
|
28 |
|
29 |
|
30 | private _regressionMessage;
|
31 | |
32 |
|
33 |
|
34 | private _timeout;
|
35 | |
36 |
|
37 |
|
38 |
|
39 | private _retries;
|
40 | |
41 |
|
42 |
|
43 |
|
44 | private _duration;
|
45 | |
46 |
|
47 |
|
48 | private _error;
|
49 | |
50 |
|
51 |
|
52 | private _skip;
|
53 | |
54 |
|
55 |
|
56 | private _completed;
|
57 | constructor(title: string, _resolveFn: IResolver<T>, _callback: ICallback<T> | undefined, options: ITestOptions);
|
58 | /**
|
59 | * Returns a boolean, telling if exception is hard. Hard exceptions
|
60 | * fails the regression tests too
|
61 | */
|
62 | private get _isHardException();
|
63 | /**
|
64 | * Runs test for given number retries
|
65 | */
|
66 | private _runTest;
|
67 | /**
|
68 | * The JSON representation of the test. This is emitted
|
69 | * as an event to show test state.
|
70 | */
|
71 | toJSON(): ITestReport;
|
72 | /**
|
73 | * Retry a test for the given number of counts, before marking
|
74 | * it as failed.
|
75 | */
|
76 | retry(counts: number): this;
|
77 | /**
|
78 | * Set explicit timeout for the given test.
|
79 | */
|
80 | timeout(duration: number): this;
|
81 | /**
|
82 | * Runs the test. If retries are defined, then the test will be retried for the
|
83 | * given number of times before marked as failed. When retrying hooks are not
|
84 | * executed again.
|
85 | *
|
86 | * ```js
|
87 | * // stack
|
88 | * [before hook 1, before hook 2]
|
89 | * [test] (2 retries)
|
90 | * [after hook 1]
|
91 | *
|
92 | * + before hook 1
|
93 | * + before hook 2
|
94 | * test (original attempt = failed)
|
95 | * test (1st attempt = passed)
|
96 | * + after hook 1
|
97 | * ```
|
98 | */
|
99 | run(): Promise<void>;
|
100 | }
|