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:
Following are the steps to create such an integration test:
- 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
- Within this folder, we create three subfolders, tests, api, and database:
$ mkdir tests api database
- Now, we open VS Code from the project root:
$ code .
- To the database folder, add an ...