UNPKG

2.02 kBTypeScriptView Raw
1import { CancellablePromise } from '@theintern/common';
2import { Executor } from './executors/Executor';
3import Deferred from './Deferred';
4import { InternError } from './types';
5import { Remote } from './executors/Node';
6import Suite from './Suite';
7export 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 readonly executor: Executor;
26 readonly hasPassed: boolean;
27 readonly id: string;
28 readonly isAsync: boolean;
29 readonly parentId: string;
30 readonly remote: Remote;
31 readonly sessionId: string;
32 readonly timeElapsed: number | undefined;
33 timeout: number;
34 async(timeout?: number, numCallsUntilResolution?: number): Deferred<any>;
35 restartTimeout(timeout?: number): void;
36 run(): CancellablePromise<void>;
37 skip(message?: string): void;
38 toJSON(): {
39 [key: string]: any;
40 };
41}
42export declare function isTest(value: any): value is Test;
43export declare function isTestOptions(value: any): value is TestOptions;
44export interface TestFunction {
45 (this: Test, test: Test): void | PromiseLike<any>;
46}
47export declare function isTestFunction(value: any): value is TestFunction;
48export interface TestProperties {
49 hasPassed: boolean;
50 name: string;
51 parent: Suite;
52 skipped: string | undefined;
53 test: TestFunction;
54 timeout: number;
55}
56export declare type TestOptions = Partial<TestProperties> & {
57 name: string;
58 test: TestFunction;
59};
60export declare const SKIP: any;