1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { AggregatedResult, SerializableError, TestCaseResult, TestResult } from '@jest/test-result';
|
8 | import type { Config } from '@jest/types';
|
9 | import type { FS as HasteFS, ModuleMap } from 'jest-haste-map';
|
10 | import type Resolver from 'jest-resolve';
|
11 | import type { worker } from './CoverageWorker';
|
12 | export declare type ReporterOnStartOptions = {
|
13 | estimatedTime: number;
|
14 | showStatus: boolean;
|
15 | };
|
16 | export declare type Context = {
|
17 | config: Config.ProjectConfig;
|
18 | hasteFS: HasteFS;
|
19 | moduleMap: ModuleMap;
|
20 | resolver: Resolver;
|
21 | };
|
22 | export declare type Test = {
|
23 | context: Context;
|
24 | duration?: number;
|
25 | path: Config.Path;
|
26 | };
|
27 | export declare type CoverageWorker = {
|
28 | worker: typeof worker;
|
29 | };
|
30 | export declare type CoverageReporterOptions = {
|
31 | changedFiles?: Set<Config.Path>;
|
32 | sourcesRelatedToTestsInChangedFiles?: Set<Config.Path>;
|
33 | };
|
34 | export declare type CoverageReporterSerializedOptions = {
|
35 | changedFiles?: Array<Config.Path>;
|
36 | sourcesRelatedToTestsInChangedFiles?: Array<Config.Path>;
|
37 | };
|
38 | export declare type OnTestStart = (test: Test) => Promise<void>;
|
39 | export declare type OnTestFailure = (test: Test, error: SerializableError) => Promise<unknown>;
|
40 | export declare type OnTestSuccess = (test: Test, result: TestResult) => Promise<unknown>;
|
41 | export interface Reporter {
|
42 | readonly onTestResult?: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise<void> | void;
|
43 | readonly onTestFileResult?: (test: Test, testResult: TestResult, aggregatedResult: AggregatedResult) => Promise<void> | void;
|
44 | readonly onTestCaseResult?: (test: Test, testCaseResult: TestCaseResult) => Promise<void> | void;
|
45 | readonly onRunStart: (results: AggregatedResult, options: ReporterOnStartOptions) => Promise<void> | void;
|
46 | readonly onTestStart?: (test: Test) => Promise<void> | void;
|
47 | readonly onTestFileStart?: (test: Test) => Promise<void> | void;
|
48 | readonly onRunComplete: (contexts: Set<Context>, results: AggregatedResult) => Promise<void> | void;
|
49 | readonly getLastError: () => Error | void;
|
50 | }
|
51 | export declare type SummaryOptions = {
|
52 | currentTestCases?: Array<{
|
53 | test: Test;
|
54 | testCaseResult: TestCaseResult;
|
55 | }>;
|
56 | estimatedTime?: number;
|
57 | roundTime?: boolean;
|
58 | width?: number;
|
59 | };
|
60 | export declare type TestRunnerOptions = {
|
61 | serial: boolean;
|
62 | };
|
63 | export declare type TestRunData = Array<{
|
64 | context: Context;
|
65 | matches: {
|
66 | allTests: number;
|
67 | tests: Array<Test>;
|
68 | total: number;
|
69 | };
|
70 | }>;
|
71 | export declare type TestSchedulerContext = {
|
72 | firstRun: boolean;
|
73 | previousSuccess: boolean;
|
74 | changedFiles?: Set<Config.Path>;
|
75 | };
|