

Category · Testing
Tests you can trust
The test pyramid, unit tests with Vitest, mocks and fakes, integration tests with a database, e2e with Playwright, coverage and flaky tests.
5 lessons60 min
To the first lessonCheatsheet nowTopics, each as its own lesson

01Why test: the pyramid and the trophyDemoWhich tests to write, how many, and what makes a test good.
10 min
02Unit tests with Vitestdescribe, it, expect, Arrange, Act, Assert, and table tests with it.each.
12 min
03Test doubles: mock, stub, spy, fakeHow they differ, how to replace time and the network, and when mocks lie.
12 min
04Integration tests with a database and an APIA real database in Docker or Testcontainers, a transaction per test, API requests with supertest.
13 min
05End to end with PlaywrightRole locators, auto waiting, fixtures, flaky tests, and what not to test with e2e.
13 min0/5 topics open. This is the course intro, not the whole course on one page.