Test
Run Vitest and fix any failing tests
Claude CodeGeneric
---
allowed-tools: Bash(npx vitest run:*), Read, Edit, Glob, Grep
description: Run Vitest and fix any failing tests
---
## Context
- Test output: !`npx vitest run --reporter=verbose 2>&1`
## Task
Analyse the test output above.
If **all tests pass**: report success and stop.
If **tests fail**:
1. Read each failing test file and the source file it exercises.
2. Determine the root cause — broken source code, wrong test expectation, or missing setup.
3. Fix the source code (preferred) or the test when the test expectation is clearly wrong.
4. Follow the project conventions in CLAUDE.md:
- Error handling pattern: catch in route handlers, return structured `{ error, code, message }` — never throw.
- ESM, async/await, zod validation.
5. Re-run `npx vitest run --reporter=verbose` after every round of fixes and repeat until all tests pass or you cannot make further progress.
6. If you cannot fix a failure, explain exactly why and what the user needs to decide.
Maintain Test?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Test on getagentictools](https://getagentictools.com/loops/griboed007-test?ref=badge) npx agentictools info loops/griboed007-test The second line is the CLI lookup for this page — handy in READMEs and docs.