Skip to content

Commit 2411699

Browse files
committed
feat: support transpiled transformers
1 parent dd13096 commit 2411699

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
- `[jest-transform]` Add support for transformers written in ESM ([#11163](https://github.com/facebook/jest/pull/11163))
2727
- `[jest-transform]` [**BREAKING**] Do not export `ScriptTransformer` class, instead export the async function `createScriptTransformer` ([#11163](https://github.com/facebook/jest/pull/11163))
2828
- `[jest-transform]` Async code transformations ([#9889](https://github.com/facebook/jest/pull/9889))
29+
- `[jest-transform]` Support transpiled transformers
2930
- `[jest-worker]` Add support for custom task queues and adds a `PriorityQueue` implementation. ([#10921](https://github.com/facebook/jest/pull/10921))
3031
- `[jest-worker]` Add in-order scheduling policy to jest worker ([10902](https://github.com/facebook/jest/pull/10902))
3132

@@ -73,6 +74,7 @@
7374
- `[*]` [**BREAKING**] Add `exports` field to all `package.json`s ([#9921](https://github.com/facebook/jest/pull/9921))
7475
- `[*]` Make it easier for Jest's packages to use the VM escape hatch ([#10824](https://github.com/facebook/jest/pull/10824))
7576
- `[*]` [**BREAKING**] Remove deprecated `mapCoverage` ([#9968](https://github.com/facebook/jest/pull/9968))
77+
- `[babel-jest]` [**BREAKING**] Migrate to ESM
7678
- `[docs]` Correct example using `browser-resolve` ([#11140](https://github.com/facebook/jest/pull/11140))
7779
- `[jest-config]` [**BREAKING**] Remove `enabledTestsMap` config, use `filter` instead ([#10787](https://github.com/facebook/jest/pull/10787))
7880
- `[jest-console]` [**BREAKING**] Move `root` into `config` and take `GlobalConfig` as mandatory parameter for `getConsoleOutput` ([#10126](https://github.com/facebook/jest/pull/10126))

Diff for: packages/babel-jest/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@ const transformer: SyncTransformer<TransformOptions> = {
167167
createTransformer,
168168
};
169169

170-
export = transformer;
170+
export default transformer;

Diff for: packages/jest-transform/src/ScriptTransformer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class ScriptTransformer {
255255
let transformer: Transformer;
256256

257257
try {
258-
transformer = require(transformPath);
258+
transformer = interopRequireDefault(require(transformPath)).default;
259259
} catch (error) {
260260
if (error.code === 'ERR_REQUIRE_ESM') {
261261
const configUrl = pathToFileURL(transformPath);

0 commit comments

Comments
 (0)