1 | import { CancellablePromise } from '@theintern/common';
|
2 | import Deferred from './Deferred';
|
3 | import { Executor } from './executors/Executor';
|
4 | import Test from './Test';
|
5 | import { InternError } from './types';
|
6 | import { Remote } from './executors/Node';
|
7 | export default class Suite implements SuiteProperties {
|
8 | after: SuiteLifecycleFunction | undefined;
|
9 | afterEach: TestLifecycleFunction | undefined;
|
10 | async: ((timeout?: number) => Deferred<void>) | undefined;
|
11 | before: SuiteLifecycleFunction | undefined;
|
12 | beforeEach: TestLifecycleFunction | undefined;
|
13 | error: InternError | undefined;
|
14 | parent: Suite | undefined;
|
15 | publishAfterSetup: boolean;
|
16 | skipped: string | undefined;
|
17 | tests: (Suite | Test)[];
|
18 | timeElapsed: number | undefined;
|
19 | private _bail;
|
20 | private _executor;
|
21 | private _name;
|
22 | private _grep;
|
23 | private _remote;
|
24 | private _sessionId;
|
25 | private _timeout;
|
26 | constructor(options: SuiteOptions | RootSuiteOptions);
|
27 | get bail(): boolean;
|
28 | set bail(value: boolean);
|
29 | get executor(): Executor;
|
30 | set executor(value: Executor);
|
31 | get grep(): RegExp;
|
32 | set grep(value: RegExp);
|
33 | get name(): string | undefined;
|
34 | set name(value: string | undefined);
|
35 | get id(): string;
|
36 | get parentId(): string | undefined;
|
37 | get remote(): Remote;
|
38 | set remote(value: Remote);
|
39 | get sessionId(): string;
|
40 | set sessionId(value: string);
|
41 | get numTests(): number;
|
42 | get numPassedTests(): number;
|
43 | get numFailedTests(): number;
|
44 | get numSkippedTests(): number;
|
45 | get hasParent(): boolean;
|
46 | get timeout(): number;
|
47 | set timeout(value: number);
|
48 | add(suiteOrTest: Suite | Test): void;
|
49 | private _applyGrepToSuiteOrTest;
|
50 | private _applyGrepToChildren;
|
51 | run(): CancellablePromise<void>;
|
52 | skip(message?: string): void;
|
53 | toJSON(): object;
|
54 | }
|
55 | export declare function isSuite(value: any): value is Suite;
|
56 | export interface SuiteLifecycleFunction {
|
57 | (this: Suite, suite: Suite): void | PromiseLike<any>;
|
58 | }
|
59 | export interface TestLifecycleFunction {
|
60 | (this: Suite, test: Test, suite: Suite): void | PromiseLike<any>;
|
61 | }
|
62 | export interface SuiteProperties {
|
63 | after: SuiteLifecycleFunction | undefined;
|
64 | afterEach: TestLifecycleFunction | undefined;
|
65 | bail: boolean | undefined;
|
66 | before: SuiteLifecycleFunction | undefined;
|
67 | beforeEach: TestLifecycleFunction | undefined;
|
68 | grep: RegExp;
|
69 | name: string | undefined;
|
70 | publishAfterSetup: boolean;
|
71 | timeout: number;
|
72 | }
|
73 | export declare type SuiteOptions = Partial<SuiteProperties> & {
|
74 | name: string;
|
75 | parent: Suite;
|
76 | tests?: (Suite | Test)[];
|
77 | };
|
78 | export declare type RootSuiteOptions = Partial<SuiteProperties> & {
|
79 | executor: Executor;
|
80 | tests?: (Suite | Test)[];
|
81 | };
|
82 | export declare type LifecycleMethod = keyof Pick<Suite, 'before' | 'after' | 'beforeEach' | 'afterEach'>;
|
83 |
|
\ | No newline at end of file |