vitest-ai-reporter
v0.0.3
Published
Token-optimized Vitest reporter for AI coding tools — 80–90% less output than the default reporter
Maintainers
Readme
Default Vitest floods AI tools with progress bars, timings, module graphs, and decorative noise. This reporter emits only what an AI needs to act: a pass count when green, and a precise failure block per broken test when not.
🤖 Works with
Claude Code, Cursor, GitHub Copilot, Cline, Aider — any AI coding tool that reads terminal output.
📦 Install
npm install -D vitest-ai-reporter
# or
pnpm add -D vitest-ai-reporter🚀 Usage
// vitest.config.ts
import { defineConfig } from 'vitest/config'
import AIReporter from 'vitest-ai-reporter'
export default defineConfig({
test: {
reporters: [new AIReporter()],
},
})🔍 Output
All tests pass — 1 line:
PASS (3) FAIL (0)Tests fail — one compact block per failure:
PASS (2) FAIL (2)
FAIL example.test.ts:13:19
math > fails on purpose
expected 2 to be 3 // Object.is equality
13| expect(1 + 1).toBe(3)
^
FAIL example.test.ts:17:19
math > multiplies two numbers
expected 12 to be 999 // Object.is equality
17| expect(3 * 4).toBe(999)
^Each failure block contains exactly what the AI needs:
- 📍 File, line, and column — no hunting
- 🧭 Full test path — no ambiguity
- ❌ Error message — what was expected
- 👇 The exact failing line with a
^pointer — no stack trace noise
📄 License
MIT
