node-jscover
v0.6.13
Published
node version of JSCover
Downloads
96
Readme
node-jscover - - A JavaScript code coverage measurement tool
node version of JSCover. only support file system instrument.
use command line tools
install jscover globally
npm install node-jscover -g
instrument supplied directory of javascript files(/lib) and save result to another directory(/out)
jscover -d /lib -o /out
similar to java version:
java -jar JSCover-all.jar -fs /lib /out
all arguments
usage doc
https://github.com/yiminghe/node-jscover/blob/master/docs/usage.md
use api
install jscover locally
npm install node-jscover
get jscover
var jscover = require('node-jscover');
method
String instrument(String code, String fileName): return instrumented code
example
var jscover = require('node-jscover');
console.log(jscover.instrument('var x=1;','test.js'));
// -> _$jscoverage['test.js'].lineData[0]++;
// -> var x = 1;
example
changelog
0.6.0
- add console reporter for mocha and jasmine: /lib/reporters/...
0.5.0
- change function count format: https://github.com/yiminghe/node-jscover/issues/1
0.4.0
- compatible with jscover
- support function count