/// /// import * as childProcess from 'child_process'; import { SoftKill } from './soft_kill'; import { Timer } from './timeout_timer'; import Reporter from './reporters/reporter'; import { Writable } from 'stream'; import { TestSpec } from './test_spec'; import { ProcessLike } from './process_like'; export type AttributesFilter = (attributes: Record) => boolean; export type ChildProcessModuleLike = { fork(..._: Parameters): ProcessLike; }; export type TestSpecFilter = (test: TestSpec) => boolean; export type TimerFactory = (timeToWait: number) => Timer; export interface Options { files: string[]; timeout?: number; listingTimeout?: number; slowThreshold?: number; graceTime?: number; attempts?: number; interface?: string; interfaceParameter?: string; clock?: () => Date; reporters?: Reporter[] | Reporter; internalErrorOutput?: Writable; disallowOnly?: boolean; attributeFilter?: AttributesFilter; testFilter?: TestSpecFilter; grep?: string | RegExp; invertGrep?: boolean; debugPort?: number; softKill?: SoftKill; timerFactory?: TimerFactory; childProcess?: ChildProcessModuleLike; runUnstable?: boolean; killSubProcesses?: boolean; parallelism?: number; signal?: AbortSignal; } export { ProcessLike, Timer, TestSpec, SoftKill }; /** * Run a set of test suites. For information about what options are supported, * please refer to the documentation in doc/suite_runner_api.md. * * Parameters for internal use only: * childProcess: Injecting the child_process module for mocking. Optional and only useful for internal testing. * timeoutTimer: Injecting the timeout_timer module for mocking. Optional and only useful for internal testing. * softKill: Injecting the soft_kill module for mocking. Optional and only useful for internal testing. * clock: Injecting a clock for mocking. Should be a function that returns a Date representing the current time. Optional and only useful for internal testing. * * Returns a promise that succeeds if no tests fail. If one or more tests fail, * the promise will fail with a TestFailureError. If the promise fails with any * other type of error, it means that there is a bug, for example in a reporter * or in the suite runner. */ export default function (options: Options): Promise;