July 2017
Intermediate to advanced
402 pages
9h 38m
English
In order to illustrate the process of writing tests for our TDD approach, we will use a tool called Mocha (https://mochajs.org/), a very common and easy-to-use JavaScript test framework, and create a test.
We will install it locally on our system using the following npm, the node.js package, manager.command:
We will first initialize npm with the following command:
$ npm init --yes
This will create a new file called package.json. Next, we will install mocha and add it to our list of development dependencies as follows:
$ npm install mocha@2.5.3 --save-dev
This will create a directory called node_modules and install Mocha in it.
In addition to Mocha, we will use a headless browser-testing module to render ...
Read now
Unlock full access