Skip to content

Commit 9b35d6c

Browse files
committed
Fix:jest-worker:should-not-expose--babel-interop
1 parent f7743bd commit 9b35d6c

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- `[jest-transform]` [**BREAKING**] Refactor API to pass an options bag around rather than multiple boolean options ([#10753](https://github.com/facebook/jest/pull/10753))
3131
- `[jest-transform]` [**BREAKING**] Refactor API of transformers to pass an options bag rather than separate `config` and other options
3232
- `[pretty-format]` [**BREAKING**] Convert to ES Modules ([#10515](https://github.com/facebook/jest/pull/10515))
33+
- `[jest-worker, jest-haste-map, jest-runner, jest-reporters]` Fix: jest-worker: should not expose `.default` babel interop ([#10623] (https://github.com/facebook/jest/pull/10623))
3334

3435
### Chore & Maintenance
3536

packages/jest-haste-map/src/__tests__/index.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jest.mock('child_process', () => ({
1919
execSync() {},
2020
}));
2121

22-
jest.mock('jest-worker', () =>
23-
jest.fn(worker => {
22+
jest.mock('jest-worker', () => ({
23+
Worker: jest.fn(worker => {
2424
mockWorker = jest.fn((...args) => require(worker).worker(...args));
2525
mockEnd = jest.fn();
2626

@@ -29,7 +29,7 @@ jest.mock('jest-worker', () =>
2929
worker: mockWorker,
3030
};
3131
}),
32-
);
32+
}));
3333

3434
jest.mock('../crawlers/node');
3535
jest.mock('../crawlers/watchman', () =>
@@ -1201,7 +1201,7 @@ describe('HasteMap', () => {
12011201
});
12021202

12031203
it('distributes work across workers', () => {
1204-
const jestWorker = require('jest-worker');
1204+
const jestWorker = require('jest-worker').Worker;
12051205
const path = require('path');
12061206
const dependencyExtractor = path.join(__dirname, 'dependencyExtractor.js');
12071207
return new HasteMap({

packages/jest-runner/src/__tests__/testRunner.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import TestRunner from '../index';
1111

1212
let mockWorkerFarm;
1313

14-
jest.mock('jest-worker', () =>
15-
jest.fn(
14+
jest.mock('jest-worker', () => ({
15+
Worker: jest.fn(
1616
worker =>
1717
(mockWorkerFarm = {
1818
end: jest.fn().mockResolvedValue({forceExited: false}),
@@ -21,7 +21,7 @@ jest.mock('jest-worker', () =>
2121
worker: jest.fn((data, callback) => require(worker)(data, callback)),
2222
}),
2323
),
24-
);
24+
}));
2525

2626
jest.mock('../testWorker', () => {});
2727

0 commit comments

Comments
 (0)