intern
Version:
Intern. A next-generation code testing stack for JavaScript.
72 lines (71 loc) • 2.36 kB
TypeScript
import Task from '@dojo/core/async/Task';
import Deferred from './Deferred';
import { Executor } from './executors/Executor';
import Test from './Test';
import { InternError } from './types';
import { Remote } from './executors/Node';
export default class Suite implements SuiteProperties {
after: SuiteLifecycleFunction | undefined;
afterEach: TestLifecycleFunction | undefined;
async: ((timeout?: number) => Deferred<void>) | undefined;
before: SuiteLifecycleFunction | undefined;
beforeEach: TestLifecycleFunction | undefined;
error: InternError | undefined;
name: string | undefined;
parent: Suite | undefined;
publishAfterSetup: boolean;
skipped: string | undefined;
tests: (Suite | Test)[];
timeElapsed: number | undefined;
private _bail;
private _executor;
private _grep;
private _remote;
private _sessionId;
private _timeout;
constructor(options: SuiteOptions | RootSuiteOptions);
bail: boolean;
executor: Executor;
grep: RegExp;
readonly id: string;
readonly parentId: string | undefined;
remote: Remote;
sessionId: string;
readonly numTests: number;
readonly numPassedTests: number;
readonly numFailedTests: number;
readonly numSkippedTests: number;
readonly hasParent: boolean;
timeout: number;
add(suiteOrTest: Suite | Test): void;
run(): Task<void>;
skip(message?: string): void;
toJSON(): object;
}
export declare function isSuite(value: any): value is Suite;
export interface SuiteLifecycleFunction {
(this: Suite, suite: Suite): void | PromiseLike<any>;
}
export interface TestLifecycleFunction {
(this: Suite, test: Test, suite: Suite): void | PromiseLike<any>;
}
export interface SuiteProperties {
after: SuiteLifecycleFunction | undefined;
afterEach: TestLifecycleFunction | undefined;
bail: boolean | undefined;
before: SuiteLifecycleFunction | undefined;
beforeEach: TestLifecycleFunction | undefined;
grep: RegExp;
name: string | undefined;
publishAfterSetup: boolean;
timeout: number;
}
export declare type SuiteOptions = Partial<SuiteProperties> & {
name: string;
parent: Suite;
tests?: (Suite | Test)[];
};
export declare type RootSuiteOptions = Partial<SuiteProperties> & {
executor: Executor;
tests?: (Suite | Test)[];
};