# Tests: how your agent proves it works

> A test is a small, automated check your coding agent writes and runs inside your project to prove that a piece of your app works as expected—and to catch any future change that accidentally breaks a feature you already built and approved.

## Analogy

Think of smoke detectors in a house. You don't press the button on every detector each morning by hand; once installed, they watch quietly and sound the alarm the moment something goes wrong.

## How it works

Clicking around your app in the browser is essential, but as your project grows you won't remember to re-check every screen after every change. A test is code that checks your code: it feeds known inputs into a function or page and verifies that the output matches what your spec promised.

Before any pull-request is ready to merge, your agent runs three layers of automated checks in the terminal. **Lint** (`npm run lint`) spots common code mistakes and style slips; **type checking** (`npx tsc --noEmit`) verifies that data shapes match across files; and **unit or integration tests** (`npm test`) check individual rules and flows.

When a bug appears and your agent fixes it during debugging, the job isn't finished until the agent adds a **regression test**: a new test that would have failed before the fix and passes now. That way, the same bug can never return silently.

## In your project

At the end of each task—and before opening or merging a pull request—your agent runs lint, type check and tests, and shows you a short summary of what passed. If anything fails, it reads the output, fixes the cause and runs the checks again before asking for your approval.

## Copy for your agent

```text
Run lint, type check and tests on my project now. Tell me in plain words what each check verified, and suggest one high-value test we should add for our most important feature.
```

---
Source: [Agentic Makers](https://agenticmakers.app/en/learn/tests) · License: CC BY 4.0
