O'Reilly logo

Effective DevOps with AWS - Second Edition by Nathaniel Felsen, Giuseppe Borgese, Yogesh Raheja

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a functional test using Mocha

In order to illustrate the process of writing tests for our TDD approach, we will use a tool called Mocha (https://mochajs.org/). Mocha is a very common and easy-to-use JavaScript test framework to create a test.

We will install it locally on our system using the following npm, the Node.js package manager command.

First, we will initialize npm with the following command:

$ npm config set registry http://registry.npmjs.org/$ npm init –yes

The output of running the preceding command is as follows:

This will create a new file called package.json. Next, we will install Mocha and add it to our list of development ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required