In my package.json
, I have:
"scripts": {
"test": "mocha --require blanket -R html-cov > test/coverage.html --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'"
},
So if I run npm test
, I get:
npm test
> [email protected] test /Users/me/Sites/my-site
> mocha --require blanket -R html-cov > test/coverage.html --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'
If I take out the blanket
stuff ("test": "mocha --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'"
), then my tests run correctly.
I am using CoffeeScript
, if that matters. What am I doing incorrectly?
According to the blanket documentation:
The coffee script loader is located in node-loaders/coffee-script.js.
You will need to add the following to your
package.json
:For example see the blanket project package.json file.
In addition, the command line you are using for the tests is incorrect. It is missing the path to your test files and the output redirection should be at the end. You should use something like: