arrange-act-assert
Version:
The lightweight "Act-Arrange-Assert" oriented testing framework
47 lines (46 loc) • 1.47 kB
TypeScript
import { SpawnTestFileOptions } from "../spawnTestFile/spawnTestFile";
import { RunTestFileOptions, Summary, TestOptions } from "../testRunner/testRunner";
import { Formatter } from "../formatters";
import { ReadDirOptions } from "../readDir/readDir";
export type TestSuiteOptions = {
parallel: number;
folder: string;
formatter: Formatter;
} & ReadDirOptions & SpawnTestFileOptions & RunTestFileOptions & TestOptions;
export type TestResult = {
files: string[];
runErrors: unknown[];
ok: boolean;
summary: Summary;
};
export type TestSuiteContext = {
getFiles(path: string, options: ReadDirOptions): Promise<string[]>;
};
export declare class TestSuite {
readonly context: TestSuiteContext;
options: {
parallel: number;
folder: string;
formatter: Formatter;
include: RegExp[];
exclude: RegExp[];
prefix: string[];
snapshotsFolder?: string;
confirmSnapshots?: boolean;
reviewSnapshots?: boolean;
regenerateSnapshots?: boolean;
coverage?: boolean;
coverageExclude?: RegExp[];
coverageNoBranches?: boolean;
coverageNoSourceMaps?: boolean;
clearModuleCache: boolean;
};
private _root;
constructor(options: Partial<TestSuiteOptions>, context?: TestSuiteContext);
run(): Promise<TestResult>;
_run(): Promise<{
files: string[];
errors: any[];
}>;
private _spawnTestFiles;
}