Skip to content

Commit

Permalink
fix(jest-worker): filtering --inspect from execArgv is unnecessary fo…
Browse files Browse the repository at this point in the history
…r thread works
  • Loading branch information
kherock committed Nov 15, 2021
1 parent 98a2b5b commit 7c63f64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/jest-worker/src/workers/NodeThreadsWorker.ts
Expand Up @@ -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,
Expand Down
Expand Up @@ -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,
Expand Down

0 comments on commit 7c63f64

Please sign in to comment.