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

API test setup

In order to test our endpoints, we'll need to be able to interact with our Express server from our test spec files.

All our endpoints are part of our Express instance, so let's export this instance and then we can import it into our tests.

So at the bottom of our server file we can go:

server/index.js

module.exports = app;

Now our server file is actually a module.

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


Click to load comments...