January 2018
Beginner
658 pages
13h 10m
English
To get started, we'll install SuperTest in our application by running npm install from the Terminal. We have the Node server still running. Let's shut that down and then install the module.
We can use npm i, the module name is supertest and we'll be grabbing the most recent version, @2.0.0. This is a test-specific module so we'll be installing it with save. We'll use save-dev to add it to the devDependencies in package.json:
npm i supertest@3.0.0 --save-dev

With SuperTest installed, we are now ready to work on the server.test.js file. As it doesn't yet exist inside the server folder, so we can create it. ...