1 | import { CancellablePromise } from '@theintern/common';
|
2 | import { Executor } from './executors/Executor';
|
3 | import Deferred from './Deferred';
|
4 | import { InternError } from './types';
|
5 | import { Remote } from './executors/Node';
|
6 | import Suite from './Suite';
|
7 | export default class Test implements TestProperties {
|
8 | name: string;
|
9 | parent: Suite;
|
10 | skipped: string | undefined;
|
11 | test: TestFunction;
|
12 | error: InternError | undefined;
|
13 | suiteError: InternError | undefined;
|
14 | protected _hasPassed: boolean;
|
15 | protected _isAsync: boolean;
|
16 | protected _timeout: number | undefined;
|
17 | protected _runTask: CancellablePromise<any> | undefined;
|
18 | protected _timeElapsed: number | undefined;
|
19 | protected _timer: any | undefined;
|
20 | protected _usesRemote: boolean;
|
21 | constructor(options: TestOptions & {
|
22 | timeElapsed?: number;
|
23 | hasPassed?: boolean;
|
24 | });
|
25 | get executor(): Executor;
|
26 | get hasPassed(): boolean;
|
27 | get id(): string;
|
28 | get isAsync(): boolean;
|
29 | get parentId(): string;
|
30 | get remote(): Remote;
|
31 | get sessionId(): string;
|
32 | get timeElapsed(): number | undefined;
|
33 | get timeout(): number;
|
34 | set timeout(value: number);
|
35 | async(timeout?: number, numCallsUntilResolution?: number): Deferred<any>;
|
36 | restartTimeout(timeout?: number): void;
|
37 | run(): CancellablePromise<void>;
|
38 | skip(message?: string): void;
|
39 | toJSON(): {
|
40 | [key: string]: any;
|
41 | };
|
42 | }
|
43 | export declare function isTest(value: any): value is Test;
|
44 | export declare function isTestOptions(value: any): value is TestOptions;
|
45 | export interface TestFunction {
|
46 | (this: Test, test: Test): void | PromiseLike<any>;
|
47 | }
|
48 | export declare function isTestFunction(value: any): value is TestFunction;
|
49 | export interface TestProperties {
|
50 | hasPassed: boolean;
|
51 | name: string;
|
52 | parent: Suite;
|
53 | skipped: string | undefined;
|
54 | test: TestFunction;
|
55 | timeout: number;
|
56 | }
|
57 | export declare type TestOptions = Partial<TestProperties> & {
|
58 | name: string;
|
59 | test: TestFunction;
|
60 | };
|
61 | export declare const SKIP: any;
|