testplane
Version:
Tests framework based on mocha and wdio
32 lines (31 loc) • 1.29 kB
TypeScript
import { ConfigurableTestObject } from "./configurable-test-object";
import { Hook } from "./hook";
import { Test } from "./test";
import type { TestObjectData, ConfigurableTestObjectData, TestFunction, TestFunctionCtx, TestTag } from "./types";
type SuiteOpts = Pick<ConfigurableTestObjectData, "file" | "id" | "location"> & TestObjectData & {
tags: TestTag[];
};
export declare class Suite extends ConfigurableTestObject {
#private;
tags: Map<string, boolean>;
static create<T extends Suite>(this: new (opts: SuiteOpts) => T, opts: SuiteOpts): T;
constructor({ title, file, id, location, tags }?: SuiteOpts);
addTag(tag: string | string[], dynamic?: boolean): void;
hasTag(tag: string): boolean;
getTags(): TestTag[];
addSuite(suite: Suite): this;
addTest(test: Test): this;
addBeforeEachHook(hook: Hook): this;
addAfterEachHook(hook: Hook): this;
beforeEach(fn: TestFunction<TestFunctionCtx>): this;
afterEach(fn: TestFunction<TestFunctionCtx>): this;
eachTest(cb: (test: Test) => void): void;
getTests(): Test[];
filterTests(cb: (test: Test) => unknown): this;
get root(): boolean;
get suites(): Suite[];
get tests(): Test[];
get beforeEachHooks(): Hook[];
get afterEachHooks(): Hook[];
}
export {};