Open pouyajabbarisani opened 4 years ago
Any luck?
@pouyajabbarisani The better solution is to use Babel to transpile ES6 import ;)
See you Romain
Take a look at the jest directories under https://github.com/standard-things/esm/tree/master/test/fixture/scenario
I'm using a NodeJs backend with ESM package enabled mode to use es6+ import modules system when I'm trying to access a file in my test, even if I use require in my test file because target file uses import/export, it throws this error:
SyntaxError: Cannot use import statement outside a module
I know, I can use babel to solve Jest problem, but due to my main project files (which are using ESM), is there any solution to config Jest with ESM?