1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { Config } from '@jest/types';
|
8 | import TestRunner = require('jest-runner');
|
9 | import { Reporter } from '@jest/reporters';
|
10 | import { AggregatedResult } from '@jest/test-result';
|
11 | import type 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 | sourcesRelatedToTestsInChangedFiles?: Set<Config.Path>;
|
20 | };
|
21 | export default class TestScheduler {
|
22 | private readonly _dispatcher;
|
23 | private readonly _globalConfig;
|
24 | private readonly _options;
|
25 | private readonly _context;
|
26 | constructor(globalConfig: Config.GlobalConfig, options: TestSchedulerOptions, context: TestSchedulerContext);
|
27 | addReporter(reporter: Reporter): void;
|
28 | removeReporter(ReporterClass: Function): void;
|
29 | scheduleTests(tests: Array<TestRunner.Test>, watcher: TestWatcher): Promise<AggregatedResult>;
|
30 | private _partitionTests;
|
31 | private _shouldAddDefaultReporters;
|
32 | private _setupReporters;
|
33 | private _setupDefaultReporters;
|
34 | private _addCustomReporters;
|
35 | /**
|
36 | * Get properties of a reporter in an object
|
37 | * to make dealing with them less painful.
|
38 | */
|
39 | private _getReporterProps;
|
40 | private _bailIfNeeded;
|
41 | }
|