From 7c63f64d7cab355f64e293ea86d7a8dea4e75a3b Mon Sep 17 00:00:00 2001 From: Kyle Herock Date: Mon, 15 Nov 2021 13:31:32 -0500 Subject: [PATCH] fix(jest-worker): filtering --inspect from execArgv is unnecessary for thread works --- packages/jest-worker/src/workers/NodeThreadsWorker.ts | 3 +-- .../src/workers/__tests__/NodeThreadsWorker.test.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/jest-worker/src/workers/NodeThreadsWorker.ts b/packages/jest-worker/src/workers/NodeThreadsWorker.ts index ee2b99150a93..5b9a3b84ef37 100644 --- a/packages/jest-worker/src/workers/NodeThreadsWorker.ts +++ b/packages/jest-worker/src/workers/NodeThreadsWorker.ts @@ -68,8 +68,7 @@ export default class ExperimentalWorker implements WorkerInterface { JEST_WORKER_ID: String(this._options.workerId + 1), // 0-indexed workerId, 1-indexed JEST_WORKER_ID }, eval: false, - // Suppress --debug / --inspect flags while preserving others (like --harmony). - execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)), + execArgv: process.execArgv, // @ts-expect-error: added in newer versions resourceLimits: this._options.resourceLimits, stderr: true, diff --git a/packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js b/packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js index afd4f1824853..9e1d6500b104 100644 --- a/packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js +++ b/packages/jest-worker/src/workers/__tests__/NodeThreadsWorker.test.js @@ -73,7 +73,7 @@ it('passes fork options down to worker_threads.Worker, adding the defaults', () expect(workerThreads.mock.calls[0][1]).toEqual({ env: process.env, // Default option. eval: false, - execArgv: ['-p'], // Filtered option. + execArgv: ['--inspect', '-p'], execPath: 'hello', // Added option. resourceLimits: undefined, stderr: true,