From 33e1e0a8ce622d0700bb7b240cf5a4676cfc4439 Mon Sep 17 00:00:00 2001 From: AndrewLeedham Date: Mon, 8 Aug 2022 11:27:04 +0100 Subject: [PATCH 1/2] fix: add workerIdleMemoryLimit to ValidConfig --- packages/jest-config/src/ValidConfig.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index 18b083bbb8bf..d77c843c0a3d 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -187,6 +187,7 @@ const initialOptions: Config.InitialOptions = { ], ], watchman: true, + workerIdleMemoryLimit: 0.2, }; export default initialOptions; From b01fc2e26a95299c6180a4a0b409941d3b4430b8 Mon Sep 17 00:00:00 2001 From: AndrewLeedham Date: Mon, 8 Aug 2022 12:16:29 +0100 Subject: [PATCH 2/2] fix: workerIdleMemoryLimit types --- packages/jest-config/src/ValidConfig.ts | 2 +- packages/jest-types/src/Config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index d77c843c0a3d..02b19ee2b820 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -187,7 +187,7 @@ const initialOptions: Config.InitialOptions = { ], ], watchman: true, - workerIdleMemoryLimit: 0.2, + workerIdleMemoryLimit: multipleValidOptions(0.2, '50%'), }; export default initialOptions; diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index 87a4eb29bdc2..fc3de9a49e64 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -327,7 +327,7 @@ export type InitialOptions = Partial<{ watchAll: boolean; watchman: boolean; watchPlugins: Array]>; - workerIdleMemoryLimit: number; + workerIdleMemoryLimit: number | string; }>; export type SnapshotUpdateState = 'all' | 'new' | 'none'; @@ -574,6 +574,6 @@ export type Argv = Arguments< watchAll: boolean; watchman: boolean; watchPathIgnorePatterns: Array; - workerIdleMemoryLimit: number; + workerIdleMemoryLimit: number | string; }> >;