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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -