Closed nicolas-zozol closed 8 years ago
You'll need you run your tests with babel-node
. The babel-instabul
package is only compiling during the instrumentation of your code. When it is actually running, it also needs to be compiled. Your test command should look something like this:
babel-node node_modules/.bin/babel-istanbul cover nodeunit -- dist/test/index.js
Then I guess it doesn't work on windows :) I have an unexpected token found in the babel-istanbul.cmd file. I will check tomorrow on linux and see.
Your unexpected token error is likely just being thrown from the babel-istanbul cli. The library itself is written in es5, so it should work if you run your test code with babel-node.
It looks like babel-istanbul doesn't want to babelize my code.
My code start in
src/test/index.js
withI launch with :
And I have
It does the same launching directly
>.\node_modules\.bin\babel-istanbul cover --dir coverage\istanbul src\test\index.js
I have ssen that a fellow lauched
>.\node_modules\.bin\babel-babel-node .\node_modules\.bin\babel-istanbul cover --dir coverage\istanbul src\test\index.js
; It fails quckly, and I don't feel your lib is written to be launched with babel-node, but it launches it directly. Is it ?