I added the following in the package.json file:
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
},
"jest": {
"testEnvironment": "jest-environment-node",
"transform": {}
},
"type": "module",
This should be sufficient https://jestjs.io/docs/ecmascript-modules
However, I still have the error:
export {
^^^^^^SyntaxError: Unexpected token 'export'
The source of the error comes from a dependency:
node_modules\object-array-utils
The version of Node is v17.4.0