From cd22c478c9390432ada049c2865c5a874401e143 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 24 Feb 2022 20:32:04 +0100 Subject: [PATCH] more defaul json serialization --- packages/jest-haste-map/src/index.ts | 2 ++ packages/jest-reporters/src/CoverageReporter.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/jest-haste-map/src/index.ts b/packages/jest-haste-map/src/index.ts index 4254eb2c52ad..a203bea0a845 100644 --- a/packages/jest-haste-map/src/index.ts +++ b/packages/jest-haste-map/src/index.ts @@ -747,6 +747,8 @@ export default class HasteMap extends EventEmitter { // @ts-expect-error: assignment of a worker with custom properties. this._worker = new Worker(require.resolve('./worker'), { exposedMethods: ['getSha1', 'worker'], + // @ts-expect-error: option does not exist on the node 12 types + forkOptions: {serialization: 'json'}, maxRetries: 3, numWorkers: this._options.maxWorkers, }) as WorkerInterface; diff --git a/packages/jest-reporters/src/CoverageReporter.ts b/packages/jest-reporters/src/CoverageReporter.ts index dc4d87daa6c1..dd1a52b99e98 100644 --- a/packages/jest-reporters/src/CoverageReporter.ts +++ b/packages/jest-reporters/src/CoverageReporter.ts @@ -144,6 +144,8 @@ export default class CoverageReporter extends BaseReporter { } else { worker = new Worker(require.resolve('./CoverageWorker'), { exposedMethods: ['worker'], + // @ts-expect-error: option does not exist on the node 12 types + forkOptions: {serialization: 'json'}, maxRetries: 2, numWorkers: this._globalConfig.maxWorkers, });