This guide details using Blanket.js with a simple mocha test setup in NodeJS.
To begin you will need:
npm install mocha -g
)Install Blanket: npm install blanket
Add the following to your package.json file:
“scripts”: {
“blanket”: {
“pattern”:
If you omit this from your package.json, Blanket will default to “src”.
Add Blanket as a require to your mocha command:
mocha --require blanket
mocha --require blanket -R html-cov > coverage.html