Istanbul: A JavaScript code coverage tool written in JS
gotwarlost.github.io
gotwarlost.github.io
The mocha integration is incredibly easy:
mocha --require blanket -R html-cov # for html outputIt's also a reason why browsers should allow some sort of tracing API for JavaScript. I know V8 and Firefox do not expose the interface because they couldn't think of a decent enough use case to justify exposing the surface area of this code. This is the use case.
./node_modules/istanbul/lib/cli.js cover -- ./node_modules/mocha/bin/_mocha -R spec
Always in my Makefile as make test-cov
However in case you use co-mocha[1] to test your generators, istanbul won't work properly, the generators in the reports are shown as uncovered. Therefore I made a mocha fork[2] and directly applied the changes from co-mocha to the source (instead of monkey patching); it solved the problem.
[1] https://github.com/blakeembrey/co-mocha [2] https://github.com/tfitos/mocha
> Since all the good ones are taken. Comes from the loose association of ideas across coverage, carpet-area coverage, the country that makes good carpets and so on...
there is zero coverage tool for this case, until browsers wake up and give me a decent Dev api like opera 12 allowed