-
Notifications
You must be signed in to change notification settings - Fork 0
Mocha
Anna Paula Maule edited this page Jul 13, 2016
·
1 revision
-
Go to admin account
-
Make sure to have Node JS installed just like for Karma/Travis/Jasmin set up
-
Run
npm config set strict-ssl false sudo npm install mocha
-
We need a library for assertions, as they are not natively supported in Mocha:
npm install chai
-
We also need a library for test doubles:
npm install sinon
-
Optionally, install Karma:
npm install karma-mocha karma-firefox-launcher --save-dev
-
Make a directory named 'test'. This is where the tests for your application should live.
-
To run tests from the command line, type:
mocha
-
For test examples and more options, check out the official Mocha documentation. Also take a look at Mocha's awesome list of test reporters (especially the JSON reporter)