Skip to content

Evaluate can't run in jest with react-native #2448

Answered by ChristianMurphy
zfben asked this question in Q&A
Discussion options

You must be logged in to vote

Welcome @zfben! 👋
Sorry you ran into a spot of trouble.

Jest needs to be configured to support ESM. https://mdxjs.com/migrating/v2/#esm
The Jest ESM guide and the ESM guide by Sindre linked in the trouble shooting section explain this more on how to configure and known bugs in Jest.

Where possible I'd recommend migrating to node:test for a fast and light weight testing experience https://nodejs.org/api/test.html
or vitest for a Jest compatible test library https://vitest.dev/
Both node:test and vitest have strong ESM support.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zfben
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants