Test First — Testing · NestJS

Two spec files describe a feature that does not exist yet, a PATCH route and an age filter. Read the failures, write the code, watch them turn green.

What you will learn

Read the theory for Test First

All Testing lessons

All NestJS courses

loading types…

Read-only: these tests are the lesson's contract. Make them pass by changing the code they test.

What you'll learn

  • Read a failing test as a specification and implement the smallest code that satisfies it
  • Keep unit and e2e specs in step: the service's contract in one, the route's in the other
  • Take the workflow home: how Jest, the Nest CLI's spec files and npm test relate to what ran here