From 18e479b9e2ca23235a266aa2df178d005b86644f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Tue, 13 Oct 2020 19:30:20 +0100 Subject: [PATCH 1/3] refactor: add missing options for timers on config.ts file Closes #10609 --- packages/jest-types/src/Config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index c492b08740df..155bc78c67a8 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'; + 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 | 'legacy'; transform: Array<[string, Path, Record]>; transformIgnorePatterns: Array; watchPathIgnorePatterns: Array; From b75656f9245ff0f83c32651ec2a93fdb5dc350dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Tue, 13 Oct 2020 20:07:40 +0100 Subject: [PATCH 2/3] refactor: add 'legacy' to Timers type on config.ts file --- packages/jest-types/src/Config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index 155bc78c67a8..ccd5e1dbd261 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -11,7 +11,7 @@ import type {ForegroundColor} from 'chalk'; type CoverageProvider = 'babel' | 'v8'; -type Timers = 'real' | 'fake' | 'modern'; +type Timers = 'real' | 'fake' | 'modern' | 'legacy'; export type Path = string; @@ -364,7 +364,7 @@ export type ProjectConfig = { testRegex: Array; testRunner: string; testURL: string; - timers: Timers | 'legacy'; + timers: Timers; transform: Array<[string, Path, Record]>; transformIgnorePatterns: Array; watchPathIgnorePatterns: Array; From 04fae39f3ef3df8df619cea31e774206e41c894c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adem=C3=ADlson=20F=2E=20Tonato?= Date: Wed, 14 Oct 2020 09:47:45 +0100 Subject: [PATCH 3/3] chore: updating changelog with fix for @jest/types --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6b581532d6..353459f3bbe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,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