BACK TO DIRECTORY
commandbeginner
/test
A comprehensive test command that runs your test suite with coverage reporting, supports watch mode for development, can target specific files or patterns, and generates both terminal and HTML coverage reports. Integrates with Vitest and Jest, automatically detects the test framework in use, and provides helpful output formatting.
456 STARS
6.8k DOWNLOADS
claude-templates
testvitestjestcoveragetdd
CONFIGURATION
markdown
1# /test Command23## Description4Run tests with coverage and optional watch mode.56## Modes78### Full Suite9```bash10pnpm run test -- --run --coverage11```1213### Watch Mode14```bash15pnpm run test -- --watch16```1718### Single File19```bash20pnpm run test -- --run src/utils/format.test.ts21```2223### Pattern Match24```bash25pnpm run test -- --run -t "should handle empty input"26```2728### Update Snapshots29```bash30pnpm run test -- --run --update31```3233## Coverage Thresholds34```json35{36 "coverage": {37 "statements": 80,38 "branches": 70,39 "functions": 75,40 "lines": 8041 }42}43```4445## Output46- Terminal: Summary table with pass/fail counts47- Coverage: HTML report at ./coverage/index.html48- Failed tests: Full error output with diff4950## Usage51- `/test` - Run all tests with coverage52- `/test watch` - Start watch mode53- `/test path/to/file` - Test specific file54- `/test --update` - Update snapshots