Monday, May 20, 2024
58
rated 0 times [  64] [ 6]  / answers: 1 / hits: 30199  / 7 Years ago, wed, april 12, 2017, 12:00:00

I'm trying to test a file which needs to import an es6 module like this:



https://repl.it/HG9t/0



It seems I'm missing some configurations to make it work properly.



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



Thank you in advance for your help.


More From » unit-testing

 Answers
34

As node does not support modules you have to compile your files using Babel. Have a look at the docs on how to configure Jest and Babel


[#58178] Monday, April 10, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josefn

Total Points: 251
Total Questions: 93
Total Answers: 84

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
;