Tests: the agent's eyes
Why tests matter so much when an AI writes your code, and what the four checks on every pull request do.
Your agent can't see your website the way you do. A test is a small program that checks one thing works — "a price of 350 cents shows as $3.50", "the sign-up form rejects a bad email". Tests are how your agent knows its change worked, instead of guessing.
The habit
- Every change comes with a new or updated test (
AGENTS.mdasks for it; your agent can copytests/example.test.ts). - Your agent runs
npm testbefore saying "done". - A test that fails is good news — it caught a problem before your visitors did.
The four checks on every pull request
| Check | What it means |
|---|---|
| Does it build? | The website compiles, and the code follows the rules (lint) |
| Do the tests pass? | Every test passes |
| Is your data protected? | Every database table has Row Level Security |
| Any secrets leaked? | No passwords or keys in your files |
Wait for four green ✓s before merging. A red ✗? Click it to read what failed — or just tell your agent "the checks failed, please fix them".
Tests check what they're told to check. They don't replace you trying the preview — do both.