Concept
A unit test checks one function or module in isolation, with its dependencies replaced, so it runs in milliseconds and points at exactly what broke. Node ships a test runner; no framework is required.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Unit tests doing its job.
import { test } from "node:test";
import assert from "node:assert/strict";
import { priceWithTax } from "../src/pricing.js";
test("adds tax and rounds to cents", () => {
assert.equal(priceWithTax(1000, 0.0825), 1083);
});
test("rejects a negative rate", () => {
assert.throws(() => priceWithTax(1000, -0.1), /rate/);
});Unit testing code that is mostly glue, such as a route handler, by mocking everything it calls. The test mirrors the implementation and passes while the real wiring is broken.
Your roadmap puts these before Unit tests, unless you already know them.
Once a session shows you understand Unit tests, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Unit tests.