Integration tests for a Node.js application

Let's now have a look at a sample integration test implemented in Node.js. Here is the setup that we are going to look into:

Integration tests for an Express JS Application

Following are the steps to create such an integration test:

  1. Let's first prepare our project folder structure. We create the project root and navigate to it:
$ mkdir ~/fod/ch07/integration-test-node && \    cd ~/fod/ch07/integration-test-node
  1. Within this folder, we create three subfolders, tests, api, and database:
$ mkdir tests api database
  1. Now, we open VS Code from the project root:
$ code .
  1. To the database folder, add an ...

Get Learn Docker - Fundamentals of Docker 19.x - 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.