From cc295f59cd93d042ce24214163f055eec79624ce Mon Sep 17 00:00:00 2001 From: Jon Wallsten Date: Tue, 30 Nov 2021 12:50:56 +0100 Subject: [PATCH] jest-worker: Avoid crash when "--max-old-space-size" inside process.execArgv (#12103) --- CHANGELOG.md | 2 ++ packages/jest-worker/src/workers/NodeThreadsWorker.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9b536940d4b..041c15f7368f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Fixes +- `[jest-worker]` Add additonal `execArgv` to filter ([#12103](https://github.com/facebook/jest/pull/12103)) + ### Chore & Maintenance ### Performance diff --git a/packages/jest-worker/src/workers/NodeThreadsWorker.ts b/packages/jest-worker/src/workers/NodeThreadsWorker.ts index 70551119b04b..f28b834a5ee2 100644 --- a/packages/jest-worker/src/workers/NodeThreadsWorker.ts +++ b/packages/jest-worker/src/workers/NodeThreadsWorker.ts @@ -67,7 +67,7 @@ export default class ExperimentalWorker implements WorkerInterface { eval: false, // Suppress --max_old_space_size flags while preserving others (like --harmony). See https://nodejs.org/api/worker_threads.html#new-workerfilename-options execArgv: process.execArgv.filter( - v => !/^--(max_old_space_size)/.test(v), + v => !/^--(max_old_space_size|max-old-space-size)/.test(v), ), // @ts-expect-error: added in newer versions resourceLimits: this._options.resourceLimits,