Course 13 · Craft
Testing
Proof that it still works.
Write the runner, then use it: assertions, doubles, fake time, async, the DOM, flakiness and what coverage will never tell you.
0 of 16 lessons finished — nothing yet
The syllabus
16 lessons,
in the order they build on each other.
What a test buys you
The four things tests are actually for, and the ones that are not worth writing.
Write the runner
A test is a function that throws. Build describe, it and expect in forty lines.
Assertions
Identity against equality, deep comparison, errors, and a failure message worth reading.
The shape of a test
Arrange, act, assert — one reason to fail, and a name that says what broke.
What to test
Behaviour, not implementation: the difference between a test that helps and one that blocks every refactor.
Test doubles
Stub, spy, mock, fake — four different things, and when each one is right.
Time and randomness
Fake timers, an injected clock and a seeded generator: making the unpredictable exact.
Asynchronous tests
Awaiting properly, testing rejection, and the test that passes because it never ran.
Integration tests
Where the real database and the real HTTP layer earn their cost — and how to keep them fast.
Testing the interface
Query the way a user finds things: by role and by name, not by class name.
End to end
What only a browser can prove, how many of those you want, and the ones worth having.
Flaky tests
The five causes, the fixes, and why a retry is a decision and not a solution.
Coverage, honestly
What the percentage measures, what it cannot, and the mutation that proves a test is real.
Test first
Red, green, refactor — where it genuinely helps and where it gets in the way.
Tests in the pipeline
Fast, parallel, deterministic — and what to do with the one that fails twice a week.
Practice: catch a real bug
A function with three bugs in it. Write the tests that find them, then fix it.
Keep going
The other courses.
HTML
The document, the elements and the meaning behind them. Everything else on the web is layered on top of this.
CSS
Selectors, the box model, layout with flexbox and grid, and motion that has a reason to move.
JavaScript
Values, functions, the DOM, events and asynchronous work — written so you can debug it later.