index.d.ts 1.4 KB

123456789101112131415161718192021222324
  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. */
  7. import Emittery = require('emittery');
  8. import type { Test, TestEvents } from '@jest/test-result';
  9. import type { Config } from '@jest/types';
  10. import type { OnTestFailure, OnTestStart, OnTestSuccess, TestRunnerContext, TestRunnerOptions, TestWatcher } from './types';
  11. export type { Test, TestFileEvent, TestEvents } from '@jest/test-result';
  12. export type { OnTestFailure, OnTestStart, OnTestSuccess, TestWatcher, TestRunnerContext, TestRunnerOptions, } from './types';
  13. export 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. }