February 2015
Intermediate to advanced
392 pages
8h 12m
English
Mocha is a modern test runner that can be executed from Node as well as inside a browser. As we saw earlier, our main approach is to use Node. In this book, I am using Mocha Version 1.20.1, but any 1.x version should be OK.
We have already installed Mocha using NPM, so we can run it with the following command:
$ me@~/validator> ./node_modules/.bin/mocha -u bdd -R spec -t 500 --recursive
It fails because we do not have any test yet; we will fix it later. I will explain the exact meaning of these parameters in a moment. For now, note that, to execute Mocha, we need to find out where NPM has installed the executable of the tool. A package can be a simple library, or it can also contain an executable command-line tool, as is the ...
Read now
Unlock full access