/test-coverage Command
Analyze test coverage, identify gaps, and generate missing tests to reach 80%+ coverage.Process
- Detect Test Framework - Identify coverage tool
- Analyze Coverage Report - List files below 80%
- Generate Missing Tests - Prioritize happy path, errors, edge cases
- Verify - Run tests and check coverage
- Report - Show before/after comparison
Supported Test Frameworks
Test Generation Priority
- Happy path - Core functionality with valid inputs
- Error handling - Invalid inputs, missing data, network failures
- Edge cases - Empty arrays, null/undefined, boundary values
- Branch coverage - Each if/else, switch case, ternary
Command Syntax
Example Output
Coverage Targets
Test Generation Rules
- Place tests adjacent to source:
foo.ts→foo.test.ts - Use existing test patterns from the project
- Mock external dependencies (database, APIs, file system)
- Each test should be independent
- Name tests descriptively:
test_create_user_with_duplicate_email_returns_409
Related
- Commands:
/tdd,/verify,/e2e