Closed
Description
Description
Since the recent move of next-intl
to ESM, running tests with Jest broke.
Verifications
- I've verified that the problem I'm experiencing isn't covered in the docs.
- I've searched for similar, existing issues on GitHub and Stack Overflow.
- I've compared my app to a working example to look for differences.
Mandatory reproduction URL
https://github.com/amannn/next-intl/tree/main/examples/example-app-router
Reproduction description
- Clone the
example-app-router
example app. - Run the
test:jest
script that is inpackage.json
.
Expected behaviour
I expect Jest to run the tests successfully.
What I tried
I feel like I tested just about every configuration combination possible in tsconfig.json
and jest.config.ts
and followed the Jest docs about using ES modules, to no avail.
I noticed that in #1470 the first breaking change mentioned is
The CommonJS build has been removed. While most tools support ESM out-of-the-box, some might require additional configuration (e.g. Jest might benefit from
next/jest
).
but I'm not sure what you mean by "Jest might benefit from next/jest
", this is probably where I missed something.