diff --git a/CHANGELOG.md b/CHANGELOG.md index a5874ce06b2f..59327bcc66b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixes - `[jest-runtime]` `require.main` is no longer `undefined` when using `jest.resetModules` ([#10626](https://github.com/facebook/jest/pull/10626)) +- `[@jest/types]` Add missing values for `timers` ([#10632](https://github.com/facebook/jest/pull/10632)) ### Chore & Maintenance diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index c492b08740df..ccd5e1dbd261 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -11,6 +11,8 @@ import type {ForegroundColor} from 'chalk'; type CoverageProvider = 'babel' | 'v8'; +type Timers = 'real' | 'fake' | 'modern' | 'legacy'; + export type Path = string; export type Glob = string; @@ -92,7 +94,7 @@ export type DefaultOptions = { testRunner: string; testSequencer: string; testURL: string; - timers: 'real' | 'fake'; + timers: Timers; transformIgnorePatterns: Array; useStderr: boolean; watch: boolean; @@ -206,7 +208,7 @@ export type InitialOptions = Partial<{ testSequencer: string; testURL: string; testTimeout: number; - timers: 'real' | 'fake'; + timers: Timers; transform: { [regex: string]: Path | TransformerConfig; }; @@ -362,7 +364,7 @@ export type ProjectConfig = { testRegex: Array; testRunner: string; testURL: string; - timers: 'real' | 'fake' | 'modern' | 'legacy'; + timers: Timers; transform: Array<[string, Path, Record]>; transformIgnorePatterns: Array; watchPathIgnorePatterns: Array;