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.
Click to load comments...