📈 Increase Test Coverage to 80% Global Target #234

Open
opened 2025-08-08 06:40:56 +00:00 by goern · 0 comments
goern commented 2025-08-08 06:40:56 +00:00 (Migrated from codeberg.org)

📋 Task 2.4: Increase Test Coverage

Priority: High | Est. Time: 4 hours | Dependencies: Task 2.3 (completed)

Current Situation

  • Current Coverage: ~6.36% (Global) | ~3.62% (lib) | 0% (components)
  • Target Coverage: 80% (Global) | 90% (lib) | 85% (components)
  • Status: Critical coverage gaps identified, failing tests need fixing

Implementation Checklist

  • Analyze current test coverage gaps (see coverage-gap-analysis.md)
  • Fix failing tests to achieve clean npm test run
  • Add missing unit tests for uncovered components
  • Add missing unit tests for uncovered lib functions
  • Add missing integration tests for critical paths
  • Ensure all test suites pass without errors
  • Achieve minimum 80% coverage threshold
  • Document coverage improvements

Coverage Goals

  • Global: 80% minimum
  • src/lib/: 90% minimum
  • src/components/: 85% minimum
  • Critical paths: 95% minimum

Key Areas to Focus

1. Components (0% Coverage) - HIGHEST PRIORITY

  • providers/NextThemesProvider.tsx
  • ui/profile components (menstrualCycle, userProfile, userProfileToken)
  • OccurrenceInput, ProfileStatistics components
  • Recording components

2. Library Functions (3.62% Coverage) - HIGH PRIORITY

  • iconMap.ts (UI icons)
  • utils.ts (utility functions)
  • weather.ts, opencage.ts, openweathermap.ts (external integrations)
  • data/recordings.ts (data access)
  • generated/zod/* (validation schemas)

3. Utilities & Helpers (0% Coverage)

  • utils/logger.ts
  • hooks/useNullable.tsx
  • strategies/iconStrategies.tsx

Success Metrics

  • All tests passing (0 failures)
  • 40% coverage by end of week
  • 60% coverage by end of 2 weeks
  • 80% coverage target achieved
  • All critical paths tested
  • Component coverage > 85%
  • Library coverage > 90%
  • /docs/testing/coverage-gap-analysis.md - Detailed gap analysis
  • /docs/unified-testing-strategy.md - Overall testing strategy
  • /docs/testing/jest-configuration.md - Jest setup documentation

Technical Notes

  • Jest configurations recently fixed for CI/CD pipeline
  • TypeScript compilation issues resolved with direct CommonJS generation
  • Test infrastructure ready for rapid test addition

Related to PR #225

## 📋 Task 2.4: Increase Test Coverage **Priority**: High | **Est. Time**: 4 hours | **Dependencies**: Task 2.3 (completed) ### Current Situation - **Current Coverage**: ~6.36% (Global) | ~3.62% (lib) | 0% (components) - **Target Coverage**: 80% (Global) | 90% (lib) | 85% (components) - **Status**: Critical coverage gaps identified, failing tests need fixing ### Implementation Checklist - [ ] Analyze current test coverage gaps (see coverage-gap-analysis.md) - [ ] Fix failing tests to achieve clean `npm test` run - [ ] Add missing unit tests for uncovered components - [ ] Add missing unit tests for uncovered lib functions - [ ] Add missing integration tests for critical paths - [ ] Ensure all test suites pass without errors - [ ] Achieve minimum 80% coverage threshold - [ ] Document coverage improvements ### Coverage Goals - **Global**: 80% minimum - **src/lib/**: 90% minimum - **src/components/**: 85% minimum - **Critical paths**: 95% minimum ### Key Areas to Focus #### 1. Components (0% Coverage) - HIGHEST PRIORITY - providers/NextThemesProvider.tsx - ui/profile components (menstrualCycle, userProfile, userProfileToken) - OccurrenceInput, ProfileStatistics components - Recording components #### 2. Library Functions (3.62% Coverage) - HIGH PRIORITY - iconMap.ts (UI icons) - utils.ts (utility functions) - weather.ts, opencage.ts, openweathermap.ts (external integrations) - data/recordings.ts (data access) - generated/zod/* (validation schemas) #### 3. Utilities & Helpers (0% Coverage) - utils/logger.ts - hooks/useNullable.tsx - strategies/iconStrategies.tsx ### Success Metrics - [ ] All tests passing (0 failures) - [ ] 40% coverage by end of week - [ ] 60% coverage by end of 2 weeks - [ ] 80% coverage target achieved - [ ] All critical paths tested - [ ] Component coverage > 85% - [ ] Library coverage > 90% ### Related Documentation - `/docs/testing/coverage-gap-analysis.md` - Detailed gap analysis - `/docs/unified-testing-strategy.md` - Overall testing strategy - `/docs/testing/jest-configuration.md` - Jest setup documentation ### Technical Notes - Jest configurations recently fixed for CI/CD pipeline - TypeScript compilation issues resolved with direct CommonJS generation - Test infrastructure ready for rapid test addition **Related to PR #225**
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
feeldata/feeldata.app#234
No description provided.