From 8ef95a6cfc462f269bf1e828b79050f832a7faeb Mon Sep 17 00:00:00 2001 From: Alexey Lavinsky Date: Fri, 30 Oct 2020 20:27:49 +0300 Subject: [PATCH] test: updated (#355) --- test/parallel-option.test.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/parallel-option.test.js b/test/parallel-option.test.js index 00f43f2c..de4e84d0 100644 --- a/test/parallel-option.test.js +++ b/test/parallel-option.test.js @@ -16,11 +16,13 @@ import { jest.mock('os', () => { const actualOs = jest.requireActual('os'); - actualOs.cpus = jest.fn(() => { - return { length: 4 }; - }); + const mocked = { + cpus: jest.fn(() => { + return { length: 4 }; + }), + }; - return actualOs; + return { ...actualOs, ...mocked }; }); // Based on https://github.com/facebook/jest/blob/edde20f75665c2b1e3c8937f758902b5cf28a7b4/packages/jest-runner/src/__tests__/test_runner.test.js