The video for this lesson is currently being updated, please read the transcript instead.

Testing server response

The question now is how can we test our Express instance. Well, there's a library designed exactly for this called Supertest.

In fact, this library was created by the developers who created Express and is therefore perfect for the job.

Let's install that by going:

$ npm i -D supertest@3

To use Supertest, let's first require it at the top of the file. The idiosyncratice way of using it is to assign the Supertest module to a constant called request:

To view the complete lesson you'll need to login or join this course.


Click to load comments...