Skip to content

Commit cca5f55

Browse files
committed
test(__mocks__): simplify manual babel mock in light of node@20 cjs-esm support
1 parent f8ffa62 commit cca5f55

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/__mocks__/@babel/core.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import * as babel from '@babel/core';
1+
// ? babel@<=7 are published in a weird way that's hostile to modification. The below allows us to spy on babel APIs. Without this, strange errors occur when Jest tries to mutate babel's weirdo module export.
22

3-
// ? Doing things this way so we can spyOn babel APIs and without this we were
4-
// ? getting errors: TypeError: Cannot set property transform of #<Object> which
5-
// ? has only a getter
6-
module.exports = { ...babel };
3+
module.exports = { ...require('@babel/core') };

0 commit comments

Comments
 (0)