node.js - Code coverage with Mocha -
i using mocha testing nodejs application. not able figure out how use code coverage feature. tried googling did not find proper tutorial. please help.
you need additional library code coverage, , going blown away how powerful , easy istanbul is. try following, after mocha tests pass (and have installed mocha globally):
npm install -g istanbul istanbul cover _mocha -- -r spec open coverage/lcov-report/index.html
note need use _mocha instead of mocha, explained here: https://github.com/gotwarlost/istanbul/issues/44
Comments
Post a Comment