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 Command
2
3## Description
4Run tests with coverage and optional watch mode.
5
6## Modes
7
8### Full Suite
9```bash
10pnpm run test -- --run --coverage
11```
12
13### Watch Mode
14```bash
15pnpm run test -- --watch
16```
17
18### Single File
19```bash
20pnpm run test -- --run src/utils/format.test.ts
21```
22
23### Pattern Match
24```bash
25pnpm run test -- --run -t "should handle empty input"
26```
27
28### Update Snapshots
29```bash
30pnpm run test -- --run --update
31```
32
33## Coverage Thresholds
34```json
35{
36 "coverage": {
37 "statements": 80,
38 "branches": 70,
39 "functions": 75,
40 "lines": 80
41 }
42}
43```
44
45## Output
46- Terminal: Summary table with pass/fail counts
47- Coverage: HTML report at ./coverage/index.html
48- Failed tests: Full error output with diff
49
50## Usage
51- `/test` - Run all tests with coverage
52- `/test watch` - Start watch mode
53- `/test path/to/file` - Test specific file
54- `/test --update` - Update snapshots