Test APIs - kimschles/schlesinger-knowledge GitHub Wiki

https://github.com/mjhea0/express-testing-mocha-knex/blob/master/test/integration/routes.users.test.js

https://code.tutsplus.com/tutorials/testing-a-nodejs-api--cms-29689

When testing an API, check for the following things:

GET

  • Lack of error message (?)
  • The response code you are expecting
  • The response type you are expecting. For example: 'Content-Type', /json/
  • Some stuff testing the shape of the data (object keys, etc.)