Skip to content

Epic: Raise unit coverage toward critical-path targets #129

@mjkatgithub

Description

@mjkatgithub

Planning

  • Milestone: Phase 4
  • Priority: P2
  • Size: XL (split into sub-issues by domain)
  • Estimate: 13+ SP (incremental; do not big-bang to 90%)

Goal

Increase meaningful unit coverage on critical paths and raise
vitest.config.ts thresholds gradually — without chasing 90% on pages/plugins
that are already covered by E2E.

Today: ~49% lines overall (npm run test:coverage); thresholds are
10–20% (intentionally low so CI passes). Target is ~90% on chosen
modules
, not 90% repo-wide in one step.

Background

Low overall % is expected while many files have 0% coverage:

  • app/pages/** (large, E2E-heavy)
  • app/plugins/**
  • Many app/utils/matrix*Permissions.ts stubs

High-value modules for unit depth first:

Follow-up to #122 and README "Test layers" section.

Scope (sub-issues to create)

  • Coverage baseline report — document per-folder % in
    docs/testing-coverage.md; list top 10 uncovered critical files
  • Matrix composables coverage — tests for messages.ts, rooms,
    session/crypto helpers; target ≥ 80% lines in app/composables/matrix/
  • Chat timeline + unread utils — target ≥ 85% on
    app/utils/chatTimeline/ and core unread helpers
  • Raise global thresholds (phase 1) — e.g. lines 30%, functions 40%,
    branches 35% after matrix + timeline slices land
  • Raise global thresholds (phase 2) — step toward 50%/60% when pages
    get selective unit tests (not required for phase 1 merge)

Definition of Done

  • Sub-issues created and linked under this epic
  • Critical modules listed above meet their per-folder targets
  • vitest.config.ts thresholds raised at least once with CI green
  • README states repo-wide % vs module targets clearly

Nicht im Scope

  • 90% on entire app/ in one milestone
  • Coverage for generated/vendor code
  • Lowering E2E count to compensate

Notes

  • Use @vitest/coverage-v8 HTML report to find dead branches, not blind
    assertion padding.
  • Exclude truly untestable glue from coverage.include only with justification
    in issue Notes.
  • Each threshold bump should be its own small PR.

Related

Metadata

Metadata

Assignees

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions