1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import Emittery = require('emittery');
|
8 | import type { JestEnvironment } from '@jest/environment';
|
9 | import type { SerializableError, Test, TestFileEvent, TestResult } from '@jest/test-result';
|
10 | import type { Config } from '@jest/types';
|
11 | import type RuntimeType from 'jest-runtime';
|
12 | export declare type ErrorWithCode = Error & {
|
13 | code?: string;
|
14 | };
|
15 | export declare type OnTestStart = (test: Test) => Promise<void>;
|
16 | export declare type OnTestFailure = (test: Test, serializableError: SerializableError) => Promise<void>;
|
17 | export declare type OnTestSuccess = (test: Test, testResult: TestResult) => Promise<void>;
|
18 | export declare type TestFramework = (globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, environment: JestEnvironment, runtime: RuntimeType, testPath: string, sendMessageToJest?: TestFileEvent) => Promise<TestResult>;
|
19 | export declare type TestRunnerOptions = {
|
20 | serial: boolean;
|
21 | };
|
22 | export declare type TestRunnerContext = {
|
23 | changedFiles?: Set<Config.Path>;
|
24 | sourcesRelatedToTestsInChangedFiles?: Set<Config.Path>;
|
25 | };
|
26 | export declare type TestRunnerSerializedContext = {
|
27 | changedFiles?: Array<Config.Path>;
|
28 | sourcesRelatedToTestsInChangedFiles?: Array<Config.Path>;
|
29 | };
|
30 | declare type WatcherState = {
|
31 | interrupted: boolean;
|
32 | };
|
33 | export interface TestWatcher extends Emittery<{
|
34 | change: WatcherState;
|
35 | }> {
|
36 | state: WatcherState;
|
37 | setState(state: WatcherState): void;
|
38 | isInterrupted(): boolean;
|
39 | isWatchMode(): boolean;
|
40 | }
|
41 | export {};
|