Skip to content

Test APIs

kimschles edited this page Jun 3, 2018 · 1 revision

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.)
Clone this wiki locally