TestScheduler.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 { Config } from '@jest/types';
  8. import { Test } from 'jest-runner';
  9. import { Reporter } from '@jest/reporters';
  10. import { AggregatedResult } from '@jest/test-result';
  11. import TestWatcher from './TestWatcher';
  12. export declare type TestSchedulerOptions = {
  13. startRun: (globalConfig: Config.GlobalConfig) => void;
  14. };
  15. export declare type TestSchedulerContext = {
  16. firstRun: boolean;
  17. previousSuccess: boolean;
  18. changedFiles?: Set<Config.Path>;
  19. };
  20. export default class TestScheduler {
  21. private _dispatcher;
  22. private _globalConfig;
  23. private _options;
  24. private _context;
  25. constructor(globalConfig: Config.GlobalConfig, options: TestSchedulerOptions, context: TestSchedulerContext);
  26. addReporter(reporter: Reporter): void;
  27. removeReporter(ReporterClass: Function): void;
  28. scheduleTests(tests: Array<Test>, watcher: TestWatcher): Promise<AggregatedResult>;
  29. private _partitionTests;
  30. private _shouldAddDefaultReporters;
  31. private _setupReporters;
  32. private _setupDefaultReporters;
  33. private _addCustomReporters;
  34. /**
  35. * Get properties of a reporter in an object
  36. * to make dealing with them less painful.
  37. */
  38. private _getReporterProps;
  39. private _bailIfNeeded;
  40. }
  41. //# sourceMappingURL=TestScheduler.d.ts.map