79143885

Date: 2024-10-31 08:09:32
Score: 1.5
Natty:
Report link

You have to execute Node with the --experimental-vm-modules flag. Here are two ways you can add this flag when running Jest:

node --experimental-vm-modules node_modules/jest/bin/jest.js

or

NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npx jest

personally this is how I handle it in my package.json script

"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --runInBand",

Source: Jest documentation

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Emanuele Caruso