UNPKG

typespec-bdd

Version:

BDD framework for TypeScript.

47 lines (46 loc) 1.72 kB
import { ITestReporter, ITestHooks } from './Hooks'; export interface Runner { run(...url: string[]): Promise<{}>; runInRandomOrder(...url: string[]): Promise<{}>; excludeTags(...tags: string[]): void; testReporter: ITestReporter; testHooks: ITestHooks; timeLimitMS: number; } export declare enum Kind { Sync = 0, Async = 1, } export declare class SpecRunner implements Runner { testReporter: ITestReporter; testHooks: ITestHooks; timeLimitMS: number; private steps; private excludedTags; private urls; private fileReader; private expectedFiles; private completedFiles; private runCompleted; constructor(testReporter?: ITestReporter, testHooks?: ITestHooks); addStep(expression: RegExp, step: Function, kind?: Kind): void; addStepAsync(expression: RegExp, step: Function): void; given(expression: RegExp, step: Function, kind?: Kind): void; givenAsync(expression: RegExp, step: Function): void; when(expression: RegExp, step: Function, kind?: Kind): void; whenAsync(expression: RegExp, step: Function): void; then(expression: RegExp, step: Function, kind?: Kind): void; thenAsync(expression: RegExp, step: Function): void; run(...url: string[]): Promise<{}>; runInRandomOrder(...url: string[]): Promise<{}>; excludeTags(...tags: string[]): void; private fileCompleted(index); private readFile(index); private processSpecification(spec, afterFeatureHandler); } export declare class SpecificationList { private specifications; constructor(specifications: string[]); randomise(): string[]; private getRandomInt(min, max); }