| name | test |
| description | Run tests and analyze results, fix failing tests |
| user-invocable | true |
| argument-hint | ["test file or pattern"] |
| allowed-tools | Bash, Read, Write, Edit, Glob |
Run tests and provide detailed analysis of results.
Process
-
Detect Test Framework
- Check
package.json for test scripts
- Look for vitest.config.ts, jest.config.ts, playwright.config.ts
-
Run Tests
npm run test -- $ARGUMENTS
npm run test -- --coverage $ARGUMENTS
npm run test:e2e -- $ARGUMENTS
-
Analyze Results
- Parse test output
- Identify failures
- Check coverage metrics
-
Fix Failures (if requested)
- Read failing test files
- Identify the issue
- Propose fix
Test Commands by Framework
Vitest
npx vitest run
npx vitest run path/to/test
npx vitest --coverage
Jest
npx jest
npx jest path/to/test
npx jest --coverage
Playwright
npx playwright test
npx playwright test file
npx playwright test --ui
Coverage Requirements
- Domain layer: 100%
- Application layer: 90%
- Components: 80%
Output Format
## Test Results
### Summary
- Total: X tests
- Passed: X
- Failed: X
- Coverage: X%
### Failures
[Details of any failing tests]
### Coverage Gaps
[Files below threshold]
### Recommendations
[Suggestions for improving test coverage]
Target: $ARGUMENTS