How to get code coverage information using Node, Mocha How to get code coverage information using Node, Mocha node.js node.js

How to get code coverage information using Node, Mocha


You should try running your test like this :

istanbul cover _mocha test/**/*.js


You need an .istanbul.yml file. I don't see any reference to it - hard to say without knowing the contents of it. I don't think there's quite enough information to solve this in the question. I'll update this answer if you update the question, especially before the bounty expires, eh?


This is how i get code coverage on all my js projects (looks like the one from Sachacr) :

istanbul cover _mocha -- -R spec --recursive test