Skip to content

Commit 8dd1bba

Browse files
committed
fix: use advanced serialization when spawning jest workers
1 parent ade6ea6 commit 8dd1bba

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- `[jest-reporter]` Handle empty files when reporting code coverage with V8 ([#10819](https://github.com/facebook/jest/pull/10819))
4242
- `[jest-resolve]` Replace read-pkg-up with escalade package ([#10781](https://github.com/facebook/jest/pull/10781))
4343
- `[jest-resolve]` Disable `jest-pnp-resolver` for Yarn 2 ([#10847](https://github.com/facebook/jest/pull/10847))
44+
- `[jest-runner]` Use advanced serialization when using workers ([#10644](https://github.com/facebook/jest/pull/10644))
4445
- `[jest-runtime]` [**BREAKING**] Do not inject `global` variable into module wrapper ([#10644](https://github.com/facebook/jest/pull/10644))
4546
- `[jest-runtime]` [**BREAKING**] remove long-deprecated `jest.addMatchers`, `jest.resetModuleRegistry`, and `jest.runTimersToTime` ([#9853](https://github.com/facebook/jest/pull/9853))
4647
- `[jest-runtime]` Fix stack overflow and promise deadlock when importing mutual dependant ES module ([#10892](https://github.com/facebook/jest/pull/10892))

packages/jest-runner/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ export default class TestRunner {
166166

167167
const worker = new Worker(TEST_WORKER_PATH, {
168168
exposedMethods: ['worker'],
169-
forkOptions: {stdio: 'pipe'},
169+
forkOptions: {
170+
// default to advanced serialization in order to match worker threads
171+
// @ts-expect-error: option does not exist on the node 10 types
172+
serialization: 'advanced',
173+
stdio: 'pipe',
174+
},
170175
maxRetries: 3,
171176
numWorkers: this._globalConfig.maxWorkers,
172177
setupArgs: [

0 commit comments

Comments
 (0)