Installing Mocha
Mocha is basically a Node.js module that provides command-line capabilities to run tests. The easiest way to use Mocha is to first install it as a global node module using npm
. To do so, just issue the following command in your command-line tool:
$ npm install –g mocha
As usual, this will install the latest version of Mocha in your global node_modules
folder. When the installation process is successfully finished, you'll be able to use the Mocha utility from your command line. Next, you'll need to install the Should.js and SuperTest assertion libraries in your project.
Note
You may experience some trouble installing global modules. This is usually a permission issue, so use sudo
or super user
when running the global install command. ...
Get MEAN Web Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.