Use below any one command to install Mocha, Chai and Sinon Module and these must to be installed as Dev Dependencies modules, because it’s not required when application running in the server but during build.
$ npm i -D mocha chai sinon
$ npm install mocha chai sinon --save-dev
If you are very much interested on how much code covered during unit testing. Try Istanbul which make test coverage simple with various types of report format.
$ npm i -D nyc
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.