What you learn
- Why agents make tests more important, not less, and the four-layer quality gate
- Writing Vitest unit tests and Playwright end-to-end tests that survive refactors
- Running the whole suite automatically with a pre-push hook and GitHub Actions
Summary
There is a myth that AI writes the code so you no longer need tests. The opposite is true. An agent will happily rewrite a working function at 2am because you asked for an unrelated change, and it has no memory of why the old behaviour mattered. Tests are how you tell future agents what must not break. This lesson builds the four-layer quality gate - types, lint, unit, end-to-end - and wires it into a pre-push hook and a CI pipeline so quality is enforced by the machine, not by your discipline.
What you will learn
You will learn what each layer of the quality stack catches, how to write a Vitest unit test and a Playwright end-to-end test that keep working after a refactor, how to block a bad push with a Git hook, and how to run the whole suite automatically on every push with GitHub Actions. By the end you can hand an agent free rein on a repo and trust the gate to catch its mistakes.
Prerequisites
A working TypeScript project from earlier courses and the hooks lesson from Course 2, since CI/CD is just the team-wide version of a pre-push gate. You do not need to be a test expert. The point of this lesson is to make testing a habit your agent does for you, not a discipline you have to remember.
TypeScript is JavaScript with type checking that catches mistakes before you run your code. Learn what it is and why so many projects use it.
npm and Bun both install the libraries your project depends on. Learn what a package manager does and how npm and Bun differ.
The terminal is a text window where you type commands to control your computer. Learn the handful of commands you actually need to get started.
GitHub is a website that stores your Git projects online so you can back them up, collaborate and deploy. Learn what it is and how to use it.
The problem
When you drive an agent hard, it touches a lot of code fast. A change to one file silently breaks another. The agent reports success because the file it edited looks right, and you only discover the regression when a page is blank in production. Manual testing does not scale to agent speed - you cannot click through every flow after every change. Without an automated gate, every agent session is a small gamble with your live product. The fix is to make "is it still working?" a question the machine answers in seconds.

Comments
Loading comments.
Post a comment