I am trying to decide on a JS test code coverage tool but cannot see clearly the differences between them. The top hits in Google are blanket.js, istanbul-js and JSCover.
Can anyone offer any information on the key differences between them and advantages/disadvantages?
Are there any other useful ones out there?
After some trying around i clearly find istanbul the most convenient tool to bring coverage analysis to a node-js project.
Istanbul uses the provided executable or js-script to perform the tests and collect coverage information. It can be installed via npm:
after successful installation simply invoke it by
respect the '_' since mocha forks the
_mocha
-executable as stated hereblanket.js for nodejs integrates easily by
basically it is ready to use after doing
after successful installation simply run your mocha tests like that
Unfortunately you have to invoke the mocha tests twice if you want to collect coverage information as well as collect test reports since you can only provide one reporter to mocha.
I can not say anything about JSCover since its installation was to complicated for me. Important for me was that i do not have to install any packages as root or even compile things since it becomes more complicated for other users to create a development environment.