Tested end to end — Capstone: the shelter service · NestJS

Prove the service works the way a client meets it: end-to-end tests that boot the whole application, sign in as staff and as an adopter, and check the rules that matter, so that each of four realistic regressions fails at least one test.

What you will learn

Read the theory for Tested end to end

All Capstone: the shelter service lessons

All NestJS courses

loading types…

What you'll learn

  • Boot the whole service in a test, configure it as main.ts does, and give every test a fresh application and database
  • Write a helper that signs in, and test authorization by trying every route as nobody, as an adopter and as staff
  • Assert what a response must not contain as well as what it must
  • Check a transaction's rollback by reading the data back after a refusal, not only the refusal's status