UNPKG

1.42 kBTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7import Emittery = require('emittery');
8import type { Test, TestEvents } from '@jest/test-result';
9import type { Config } from '@jest/types';
10import type { OnTestFailure, OnTestStart, OnTestSuccess, TestRunnerContext, TestRunnerOptions, TestWatcher } from './types';
11export type { Test, TestFileEvent, TestEvents } from '@jest/test-result';
12export type { OnTestFailure, OnTestStart, OnTestSuccess, TestWatcher, TestRunnerContext, TestRunnerOptions, } from './types';
13export default class TestRunner {
14 private readonly _globalConfig;
15 private readonly _context;
16 private readonly eventEmitter;
17 readonly __PRIVATE_UNSTABLE_API_supportsEventEmitters__: boolean;
18 readonly isSerial?: boolean;
19 constructor(globalConfig: Config.GlobalConfig, context?: TestRunnerContext);
20 runTests(tests: Array<Test>, watcher: TestWatcher, onStart: OnTestStart | undefined, onResult: OnTestSuccess | undefined, onFailure: OnTestFailure | undefined, options: TestRunnerOptions): Promise<void>;
21 private _createInBandTestRun;
22 private _createParallelTestRun;
23 on<Name extends keyof TestEvents>(eventName: Name, listener: (eventData: TestEvents[Name]) => void | Promise<void>): Emittery.UnsubscribeFn;
24}