Chapter 10: Tests

Test runner

The program that finds your tests, runs them, prints what failed, and exits with a code saying whether everything passed. Examples are bun test, Vitest, pytest and Playwright Test.

The exit code is what lets a hook or a pipeline stop an agent. A runner that prints a failure but exits 0 lets the agent carry on as if nothing happened.

Say it to your agent

“Add a "test" script to package.json that runs bun test. Show me that it exits 1 when I break a test on purpose, and 0 again when I put it back.”

The workshop

Name a word, or describe what you mean in everyday language.