Senior Backend Engineer / Stage 5 · Testing and delivery

Test handlers, storage and client contracts

Write unit, real-database and consumer tests.

CoreIntermediateDraft, not yet reviewed40 min of activities

"Already know" meets prerequisites. "Not relevant" removes the topic from your total but leaves what builds on it waiting.

Self-check

  • A mocked repository accepts duplicate order IDs, but production PostgreSQL rejects them. Describe a focused handler test, a real-database transaction test and an old-client response-contract test. Which defect can each detect, and which can it miss?
  • Evidence to include: Demonstrate at least one failing assertion before correcting the defect. Use an isolated database/schema and deterministic cleanup. A schema assertion alone does not prove that a real consumer can interpret the response.

Try it without the material first, then compare. Save your answer in your notes below. Report a problem with this self-check

Learning activities

3 activities
  • Not done
    Testing (opens another site)
    ReadOther sitelink checked 2026-11-15

    The official guide to testing modules, overriding providers and sending requests to a Fastify app with inject, the same style this platform's API tests use.

    25 min
  • Not done
    PostgreSQL - Testcontainers for NodeJS (opens another site)
    ReadOther sitelink checked 2026-11-15

    Starts a real, throwaway PostgreSQL from a test and hands back its connection URI, so storage tests run against the database you ship.

    5 min
  • Not done
    How Pact works (opens another site)
    ReadOther sitelink checked 2026-11-15

    Explains consumer tests against a mock provider and provider verification that replays them, the clearest picture of what a contract test proves.

    10 min

My notes

Saved on this device, synced when signed in
Esc
↑ ↓ to move↵ to open