Run project tests and validate code quality through comprehensive testing
Runs project tests and analyzes coverage gaps to validate code quality.
/plugin marketplace add thkt/claude-config/plugin install complete-workflow-system@thkt-development-workflows[test scope or specific tests]inheritRun project tests and ensure code quality through comprehensive testing and validation.
!`ls package*.json 2>/dev/null | head -1`
Use TodoWrite to track testing progress.
First, check available scripts in package.json:
cat package.json
Then run appropriate test command:
npm test
Alternative package managers:
yarn test
pnpm test
bun test
Run tests with coverage:
npm test -- --coverage
Check coverage directory:
ls coverage/
Purpose: Automatically identify missing tests and suggest improvements based on coverage data.
Use test-generator agent to analyze coverage gaps:
Task({
subagent_type: "test-generator",
description: "Analyze test coverage gaps",
prompt: `
Test Results: ${testResults}
Coverage: ${coverageData}
Analyze gaps:
1. Uncovered code: files <80%, untested functions, branches [✓]
2. Missing scenarios: edge cases, error paths, boundaries [→]
3. Quality issues: shallow tests, missing assertions [→]
4. Generate test code for priority areas [→]
Return: Test code snippets (not descriptions), coverage improvement estimate.
Mark: [✓] verified gaps, [→] suggested tests.
`
})
## Test Coverage Gaps
### High Priority (< 50% coverage)
- **File**: src/utils/validation.ts
- **Lines**: 45-67 (23 lines uncovered)
- **Issue**: No tests for error cases
- **Suggested Test**:
```typescript
describe('validation', () => {
it('should handle invalid input', () => {
expect(() => validate(null)).toThrow('Invalid input')
})
})
```
### Medium Priority (50-80% coverage)
- **File**: src/services/api.ts
- **Lines**: 120-135
- **Issue**: Network error handling not tested
### Edge Cases Not Covered
1. Boundary conditions (empty arrays, null values)
2. Concurrent operations
3. Timeout scenarios
### Estimated Impact
- Adding suggested tests: 65% → 85% coverage
- Effort: ~2 hours
- Critical paths covered: 95%+
npm run lint
npm run type-check
Alternative:
npx tsc --noEmit
npm run format:check
Provide clear summary of:
For failed tests:
When coverage is available:
Automatic task tracking:
1. Discover test infrastructure
2. Run test suite
3. Analyze failures (if any)
4. Generate coverage report
5. Analyze test gaps (NEW - test-generator)
6. Execute quality checks
7. Summarize results
Enhanced with test-generator: Step 5 now includes automated gap analysis and test suggestions.
Based on results:
/fix to address specific failures