Testing: unit, integration, e2e

Lesson 04 · 13 min

Integration tests with a database and an API

A real database in Docker or Testcontainers, a transaction per test, API requests with supertest.

13 minLesson 4 of 5Practice includedAsk AI on any point

An integration test checks several parts together: an SQL query and a real database, an HTTP route and the service behind it. This is where you catch bugs that unit tests miss: an SQL mistake, a forgotten migration, a violated unique index, a wrong response status.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.