Skip to content
node version of JSCover
JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
docs
lib
test
.gitignore
.jshintrc
.npmignore
.travis.yml
README.md
package.json

README.md

node-jscover - - A JavaScript code coverage measurement tool

NPM version NPM downloads Build Status Coverage Status

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

short name full name type default description
-d --dir String directory of javascript source files
-o --out String destination directory of instrumented javascript source files
-f --front Boolean false whether output JSCover front-end files to destination directory

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
name type description
code String code to be instrumented
fileName String fileName of 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

xtemplate coverage info

xtemplate coverage info

changelog

0.6.0

  • add console reporter for mocha and jasmine: /lib/reporters/...

0.5.0

0.4.0

You can’t perform that action at this time.