-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6237176
commit 977e592
Showing
10 changed files
with
542 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,28 @@ | ||
// Common type aliases for better code readability | ||
|
||
import type { | ||
Config as JestConfig, | ||
TestResult as JestTestResult, | ||
} from '@jest/types'; | ||
import type * as JestRunner from 'jest-runner'; | ||
|
||
export type Milliseconds = JestTestResult.Milliseconds; | ||
export type Path = JestConfig.Path; | ||
|
||
export interface TestDetail { | ||
title: string; | ||
path: Path; | ||
} | ||
import type { TestContext, TestResult } from '@jest/test-result'; | ||
import type { Config, TestRunnerOptions } from 'jest-runner'; | ||
|
||
export interface CreateRunnerOptions< | ||
ExtraOptionsType extends Record<string, unknown>, | ||
ExtraOptions extends Record<string, unknown>, | ||
> { | ||
getExtraOptions?: () => ExtraOptionsType; | ||
getExtraOptions?: () => ExtraOptions; | ||
} | ||
|
||
// Copied and adapted from https://github.com/facebook/jest/blob/2dafb09d51584d3785f3280f569784ec4334b5d8/packages/jest-runner/src/index.ts#L48-L285 | ||
export declare abstract class TestRunner { | ||
readonly _globalConfig: JestConfig.GlobalConfig; | ||
|
||
readonly _context: JestRunner.TestRunnerContext; | ||
|
||
constructor( | ||
globalConfig: JestConfig.GlobalConfig, | ||
context?: JestRunner.TestRunnerContext, | ||
); | ||
export type RunTestOptions< | ||
ExtraOptions extends Record<string, unknown> = Record<string, unknown>, | ||
> = { | ||
config: Config.ProjectConfig; | ||
extraOptions: ExtraOptions; | ||
globalConfig: Config.GlobalConfig; | ||
rawModuleMap: ReturnType<TestContext['moduleMap']['getRawModuleMap']> | null; | ||
options: TestRunnerOptions; | ||
testPath: string; | ||
}; | ||
|
||
export type RunTest< | ||
ExtraOptions extends Record<string, unknown> = Record<string, unknown>, | ||
> = (options: RunTestOptions<ExtraOptions>) => TestResult | Promise<TestResult>; | ||
|
||
runTests( | ||
tests: Array<JestRunner.Test>, | ||
watcher: JestRunner.TestWatcher, | ||
onStart: JestRunner.OnTestStart, | ||
onResult: JestRunner.OnTestSuccess, | ||
onFailure: JestRunner.OnTestFailure, | ||
options: JestRunner.TestRunnerOptions, | ||
): Promise<void>; | ||
export interface TestDetail { | ||
title: string; | ||
path: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.