Skip to content

Commit

Permalink
jest-worker: Avoid crash when "--max-old-space-size" inside process.e…
Browse files Browse the repository at this point in the history
…xecArgv (#12103)
  • Loading branch information
JonWallsten authored Nov 30, 2021
1 parent 1d197dd commit cc295f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Fixes

- `[jest-worker]` Add additonal `execArgv` to filter ([#12103](https://github.com/facebook/jest/pull/12103))

### Chore & Maintenance

### Performance
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-worker/src/workers/NodeThreadsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cc295f5

Please sign in to comment.