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.