This project maintains strict anti-cluttering standards to prevent test file proliferation while ensuring comprehensive coverage and quality.
⚠️ TESTING AGENT: Update this section with latest metrics after every test suite run
- Total Tests: 1017 tests
- Test Success: 1017/1017 (100% success rate)
- Coverage: 79.57% overall (86.15% services, 90.25% components, 94.47% utils)
- Test Files: 35 consolidated files
- Last Updated: 2025-07-30 06:57:19 - Production-ready quality maintained
- Quality Status: EXCELLENT - Zero failures, comprehensive coverage across all modules
✅ GOOD - Consolidated approach:
- githubService.test.ts (50 tests - ALL functionality)
- gitlabService.test.ts (33 tests - ALL functionality)
- MarkdownViewer.test.tsx (38 tests - ALL functionality)
- TodoSidebar.test.tsx (39 tests - ALL functionality)
❌ BAD - Cluttered approach that was eliminated:
- githubService.test.ts
- githubService.core.test.ts
- githubService.edge-cases.test.ts
- githubService.integration.test.ts
- githubService.errorHandling.test.ts
- githubService.folderFiltering.test.ts
[...and 10 more files testing the same service]
NEVER create these types of files:
Component.draft.test.tsx→ Add draft tests toComponent.test.tsxComponent.strategy.test.tsx→ Add strategy tests toComponent.test.tsxComponent.quick.test.tsx→ Add quick tests toComponent.test.tsxservice.integration.test.ts→ Add integration tests toservice.test.tsservice.errorHandling.test.ts→ Add error tests toservice.test.ts
Rule: If you're tempted to create X.something.test.ts, add those tests to X.test.ts instead.
- Initial Analysis
npm run test:coverage -- --testTimeout=300000- Target Low-Hanging Fruit (85-95% coverage files)
# Focus on files with small gaps, avoid complex service logic
# Example targets: utility functions, error handling, edge cases- Strategic Implementation
# Test individual files to verify improvements
npm test src/utils/__tests__/[targetFile].test.ts- Verify & Document
# Always verify coverage improvement
npm run test:coverage -- --testTimeout=300000- Services: Target 80-95% (complex caching logic may limit)
- Components: Target 70-90% (UI edge cases are acceptable gaps)
- Utils: Target 90-100% (pure functions should be fully testable)
- ✅ 100% Test Success: All tests must pass before commit
- ✅ No Duplicated Logic: Tests for same functionality go in same file
- ✅ Comprehensive Error Handling: Cover error paths and edge cases
- ✅ Production Patterns: Test real-world usage scenarios
# Component Tests
src/components/__tests__/ComponentName.test.tsx
# Service Tests
src/services/__tests__/serviceName.test.ts
# Utility Tests
src/utils/__tests__/utilityName.test.ts
# Integration Tests (if needed)
src/__tests__/IntegrationName.test.tsxdescribe('ComponentName', () => {
// 🎯 Core functionality first
describe('Core Functionality', () => {
it('should handle primary use case', () => {});
it('should handle secondary use case', () => {});
});
// 🛡️ Error handling second
describe('Error Handling', () => {
it('should handle API errors gracefully', () => {});
it('should handle invalid inputs', () => {});
});
// 🔧 Edge cases last
describe('Edge Cases', () => {
it('should handle empty state', () => {});
it('should handle boundary conditions', () => {});
});
});npm test # Interactive test runner (watch mode)
npm run test:coverage # Full coverage report
npm test [specific-file] # Test individual file# Use proper timeout for accurate results
npm run test:coverage -- --testTimeout=300000npm install
npm run test:coverage
npm run build- 100% Test Success: All tests must pass before any commit
- Consolidated Structure: One comprehensive file per component/service
- Production Patterns: Test real-world usage scenarios and error paths
- Comprehensive Coverage: Target 80%+ with focus on critical paths
- No Test Cluttering: Strictly follow anti-patterns prevention rules
- Coverage Distribution: Services (80-95%), Components (70-90%), Utils (90-100%)
- File Organization: Consolidated approach prevents cluttering
- Test Reliability: Stable, deterministic tests with proper mocking
- Error Handling: Comprehensive coverage of failure scenarios
Before creating a new test file, ask:
1. Does [Component/Service].test.tsx already exist?
→ YES: Add tests there
→ NO: Create [Component/Service].test.tsx
2. Are you testing the same component/service?
→ YES: Add to existing file
→ NO: Create new file with proper naming
3. Would this create duplication?
→ YES: Consolidate into existing file
→ NO: Proceed with new tests
// ✅ GOOD: Add tests to existing comprehensive file
describe('ExistingComponent', () => {
// Existing tests...
// 🆕 Add new functionality tests here
describe('New Feature', () => {
it('should handle new feature correctly', () => {});
});
});
// ❌ BAD: Don't create ExistingComponent.newFeature.test.tsx- Development Guide: CLAUDE.md - Anti-test-cluttering guidelines and development practices
- Feature Documentation: features/implementation-evidence.md - Feature validation evidence
The testing-agent MUST update the "Current Test Status" section after every test suite operation:
- Run
npm run test:coverage -- --testTimeout=300000 - Update all metrics in the status section
- Include timestamp and quality assessment
- Ensure accuracy of all reported numbers
- Maintain 100% test success rate
- Follow anti-cluttering guidelines strictly
- Ensure comprehensive error handling coverage
- Fix any TypeScript or ESLint issues immediately
These guidelines maintain testing excellence by:
- Preventing test file proliferation through strict anti-cluttering rules
- Ensuring comprehensive coverage while maintaining quality standards
- Providing clear decision frameworks for test organization
- Maintaining production-ready reliability with consistent standards
Follow these guidelines to prevent test cluttering and maintain excellence!