Skip to content

Commit 8ef95a6

Browse files
test: updated (#355)
1 parent 661d1f8 commit 8ef95a6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/parallel-option.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import {
1616
jest.mock('os', () => {
1717
const actualOs = jest.requireActual('os');
1818

19-
actualOs.cpus = jest.fn(() => {
20-
return { length: 4 };
21-
});
19+
const mocked = {
20+
cpus: jest.fn(() => {
21+
return { length: 4 };
22+
}),
23+
};
2224

23-
return actualOs;
25+
return { ...actualOs, ...mocked };
2426
});
2527

2628
// Based on https://github.com/facebook/jest/blob/edde20f75665c2b1e3c8937f758902b5cf28a7b4/packages/jest-runner/src/__tests__/test_runner.test.js

0 commit comments

Comments
 (0)