Setting up tests
We'll be using jest
and supertest
to test our API. This ensures our code does what we intended and continues to do so.
npm i supertest @types/supertest jest @types/jest ts-jest
Next, we'll initialize a jest config:
npx ts-jest config:init
.
We're now ready to test!