I've got a couple of issues with unit testing js files.
First error: If the js file I am testing has no dependancies, it's working fine. However, when there are imports at the top, it does not work and throws an error saying it cannot find the file:
Error: Cannot find module 'myModule'
Do I somehow need to link the jspm.config file to the process and if so, how?
Second error: When I hard code the dependancy link to the file, I'm getting a syntax error that I wouldn't usually get when testing ES6 files:
I've got a couple of issues with unit testing js files.
First error: If the js file I am testing has no dependancies, it's working fine. However, when there are imports at the top, it does not work and throws an error saying it cannot find the file:
Do I somehow need to link the jspm.config file to the process and if so, how?
Second error: When I hard code the dependancy link to the file, I'm getting a syntax error that I wouldn't usually get when testing ES6 files:
Do I need to do something to tell it my dependancies are ES6?
I am running the following from the command line:
mocha <test filename here> --compilers js:babel-register
.The top of my test file looks like this:
I am using
"babel-register": "^6.11.6"
. Thanks for any help you can provide.