-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage using Istanbul #44
Comments
@riteshe63 looks good but a few points.
|
Sorry some point were missing previously. Those point have been resolved and included here:
|
@riteshe63 for 2. We will use grunt instead of npm scripts so the main this is 3. where we have to figure out how to integrate everything with Grunt. Regarding 4, By |
Regarding the 2nd point, we will run the code coverage command mentioned below without For the 4th point, When we run the above mentioned command then it will create a |
@riteshe63 Everything looks good, just let me know about front end tests. Continued in #74 |
Istanbul is a code coverage tool for JavaScript.
To run Istanbul with Mocha, you can use this command:
npm install istanbul
./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha -- -R spec
node_modules/.bin/istanbul test
runs the istanbul executable with thetest
command.node_modules/.bin/_mocha
points to the mocha executable which is how my tests are run.-R spec
are my arguments for mocha.--
tells istanbul to pass the following arguments the test process rather than consume them itself.Mocha users, note the
_mocha
executable path contains an underscore. This is because the executable without an underscore forks processes to run your tests.You can now run your tests with:
npm test
Istanbul just runs your tests for you without instrumenting.
And generate a coverage report with:
npm test --coverage
You will get some terminal output, with any luck 100% coverage like module:
===== Coverage summary ======
Statements : 100% ( 64/64 )
Branches : 100% ( 30/30 )
Functions : 100% ( 13/13 )
Lines : 100% ( 58/58 )
============= ================
…and an html coverage report at
./coverage
The text was updated successfully, but these errors were encountered: