Jest es6 modules: importing an unexpected module

I am trying to test a file that needs to import an es6 module like this:

https://repl.it/HG9t/0

I seem to be missing some configurations for it to work correctly.

If you can easily achieve this with another unit testing framework, I'm wondering too.

Thank you in advance for your help.

+3


source to share


1 answer


Since node does not support modules, you have to compile your files with Babel. Check out the docs on how to set up Jest and Babel



+3


source







All Articles