Heads up! To view this whole video, sign in with your Courses Plus account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Code Coverage with Istanbul!
You have completed Code Coverage with Istanbul!
Preview
In this video we'll set up Istanbul in a simple calculator project.
Resources
Code Downloads
git clone https://github.com/treehouse-projects/calculator.js-code-coverage calculator.js
Commands
npm install istanbul --save-dev
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha
If you're using a more complex testing directory with sub-folders you should use the recursive flag like this:
./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- -recursive
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Change into the directory and install
the current development dependencies.
0:06
Npm install should install
the testing framework Mocha and
0:14
the assertion library Chai.
0:18
The calculative functionality
is in the index.js file.
0:23
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up