Node.js 15.9 regression with Jest ESM
After upgrading Node.js 15.8 → 15.9 Jest stopped supporting ESM.
- Version: 15.9
- Platform:
Linux foxbat 5.10.15-200.fc33.x86_64 #1 SMP Wed Feb 10 17:46:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
What steps will reproduce the bug?
echo '{ "private": true, "type": "module" }' > package.json yarn add nanoevents echo "import { createNanoEvents } from 'nanoevents'" > index.js echo "import './index.js'; it.todo('test')" > index.test.js yarn add jest@next
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
volta install node@15.8 node --experimental-vm-modules node_modules/.bin/jest (node:60479) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) PASS ./index.test.js ✎ todo test Test Suites: 1 passed, 1 total Tests: 1 todo, 1 total Snapshots: 0 total Time: 0.173 s Ran all test suites.
What do you see instead?
volta install node@15.9 node --experimental-vm-modules node_modules/.bin/jest (node:60418) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) FAIL ./index.test.js ● Test suite failed to run linking error, dependency promises must be resolved on instantiate