← REST API Development learning path
REST API Development · Module 9 of 10

Testing APIs

Make sure your API works with automated tests.

📖 Key ideas

  1. Test happy paths and error paths.
  2. Tools: Postman/Insomnia for manual, Supertest/pytest/RestAssured for automated.
  3. Contract tests check responses match the spec.
  4. Load tests (k6, JMeter) check performance.
  5. Run tests in CI on every change.
💡 Real-life example: Testing an API is a mystery shopper visiting every counter and noting each problem.
Integration testTests endpoints with real components
Contract testChecks API matches its spec
Load testMeasures behaviour under many users
k6Load testing tool