Skip to content

chore: remove Babel transform from Jest#3813

Draft
cpaulve-1A wants to merge 1 commit intomainfrom
chore/remove-babel
Draft

chore: remove Babel transform from Jest#3813
cpaulve-1A wants to merge 1 commit intomainfrom
chore/remove-babel

Conversation

@cpaulve-1A
Copy link
Contributor

@cpaulve-1A cpaulve-1A commented Dec 15, 2025

Proposed change

Remove babel transform as jest now support esm files

Warning

This PR cannot be merged in this state. Today, the support of esm in jest is experimental and brings the following constraint (https://jestjs.io/docs/ecmascript-modules):

  • Test with mix of ts and mts must be run with the option --experimental-vm-modules.
  • Support of esm module mock is experimental (https://jestjs.io/docs/ecmascript-modules#module-mocking-in-esm) and not fully supported
  • Support of esm module is not supported by esm preset angular
  • Style dictionary use of fs seems to clash with esm mocking

Related issues

🚀 Feature #3797

TODO

  • Refactor to share mts/ts setup between relevant projects

* Required for ESM support with .mts files
* @see https://kulshekhar.github.io/ts-jest/docs/guides/esm-support#resolve-mjsmts-extensions
*/
module.exports = (path, options) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if required even with the pathMapper

...getJestIntegrationTestConfig()
...getJestIntegrationTestConfig(),
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts', '.mts'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be inherited from otterBaseConfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant