Skip to content

[Improvement] Increase test coverage from ~25% to meaningful thresholds #193

@d-oit

Description

@d-oit

Description

Current test coverage is extremely low, far below the 80% target mentioned in agents-docs/CONFIG.md:

Metric Current Target
Branches 14% 80%
Functions 16% 80%
Lines 25% 80%
Statements 24% 80%

Untested Components (0% coverage)

  • Chat.tsx — No unit tests
  • AIHarness.tsx — No unit tests
  • ExportPanel.tsx — No unit tests
  • MindMapView.tsx — No unit tests
  • GraphView.tsx — No unit tests
  • ErrorBoundary.tsx — No unit tests
  • ThemeSwitcher.tsx — No unit tests
  • MobileDrawer.tsx — No unit tests
  • DbProvider.tsx — No unit tests
  • openrouter.ts / kilo.ts — No unit tests (LLM providers)
  • CLI (cli/index.ts, cli/db.ts) — Zero test coverage

Partially Tested

  • search.ts — Semantic search/embeddings not tested
  • nlp.ts — Only basic tests, no edge cases
  • resolver.ts — Limited error path testing

Recommended Approach

  1. Phase 1 (Target: 50%): Add tests for all untested components with critical paths
  2. Phase 2 (Target: 65%): Add edge case tests and error path coverage
  3. Phase 3 (Target: 80%): Add comprehensive integration tests

Priority Test Targets

  1. ExportPanel (security-critical — XSS)
  2. AIHarness (complex async logic)
  3. Chat (user-facing feature)
  4. CLI commands
  5. LLM providers (mock API calls)

Acceptance Criteria

  • Coverage thresholds raised to at least 50% initially
  • All untested components have at least basic tests
  • CLI has integration tests
  • Security-critical paths (export, LLM) have dedicated tests
  • CI runs test:coverage and reports results

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions