Skip to content

Commit

Permalink
fix: use advanced serialization when spawning jest workers
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Dec 30, 2020
1 parent 6e282ca commit ff90e08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -41,6 +41,7 @@
- `[jest-reporter]` Handle empty files when reporting code coverage with V8 ([#10819](https://github.com/facebook/jest/pull/10819))
- `[jest-resolve]` Replace read-pkg-up with escalade package ([#10781](https://github.com/facebook/jest/pull/10781))
- `[jest-resolve]` Disable `jest-pnp-resolver` for Yarn 2 ([#10847](https://github.com/facebook/jest/pull/10847))
- `[jest-runner]` Use advanced serialization when using workers ([#10644](https://github.com/facebook/jest/pull/10644))
- `[jest-runtime]` [**BREAKING**] Do not inject `global` variable into module wrapper ([#10644](https://github.com/facebook/jest/pull/10644))
- `[jest-runtime]` [**BREAKING**] remove long-deprecated `jest.addMatchers`, `jest.resetModuleRegistry`, and `jest.runTimersToTime` ([#9853](https://github.com/facebook/jest/pull/9853))
- `[jest-runtime]` Fix stack overflow and promise deadlock when importing mutual dependant ES module ([#10892](https://github.com/facebook/jest/pull/10892))
Expand Down
7 changes: 6 additions & 1 deletion packages/jest-runner/src/index.ts
Expand Up @@ -166,7 +166,12 @@ export default class TestRunner {

const worker = new Worker(TEST_WORKER_PATH, {
exposedMethods: ['worker'],
forkOptions: {stdio: 'pipe'},
forkOptions: {
// default to advanced serialization in order to match worker threads
// @ts-expect-error: option does not exist on the node 10 types
serialization: 'advanced',
stdio: 'pipe',
},
maxRetries: 3,
numWorkers: this._globalConfig.maxWorkers,
setupArgs: [
Expand Down

0 comments on commit ff90e08

Please sign in to comment.