Skip to content

test(fix,report): cover notes content, info-severity handling, multi-file fix, and info label#17

Merged
protosphinx merged 1 commit into
mainfrom
bot/fix-report-test-coverage
May 11, 2026
Merged

test(fix,report): cover notes content, info-severity handling, multi-file fix, and info label#17
protosphinx merged 1 commit into
mainfrom
bot/fix-report-test-coverage

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

Four specific code paths in fix.ts and report.ts had no test coverage. These are not hypothetical: outcome.notes is part of the FixOutcome public type (returned to callers and shown in the CLI report), the info-severity bypass in applyFixes is a deliberate behavioral contract, and the info label branch in reportText is operator-facing output. Pinning them with tests prevents silent regressions as the codebase evolves toward v1.0.

What

  • test/fix.test.ts: three new cases
    • Asserts outcome.notes is populated and contains the rule name and corrected name after a name-drift fix
    • Asserts that info-severity diagnostics are silently ignored (not counted as skipped) - this is the intentional contract in applyFixes
    • Asserts that fixing name-drift on two different files in a single call rewrites both correctly
  • test/report.test.ts: one new case
    • Asserts that an info-severity diagnostic line renders with the "info" label (the pc.cyan("info ") branch was only covered by the footer-count test, not by a line-content assertion)

Tests

All 80 tests pass (vitest run), up from 76 before this PR. Lint (tsc --noEmit) and build are clean.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

…file fix, and info label

Three gaps in fix.test.ts:
- applyFixes outcome.notes is never asserted; add a case that verifies
  it contains "name-drift" and the corrected name
- info-severity diagnostics are silently ignored (not counted as skipped)
  per the code, but no test pinned that contract
- fixing name-drift on multiple files in one call was untested

One gap in report.test.ts:
- the info branch of the per-line severity label (pc.cyan("info "))
  was exercised only by the footer-count test, not by a line-content check
@protosphinx protosphinx added the automated Opened by the daily bot label May 11, 2026 — with Claude
@protosphinx protosphinx merged commit 58461a4 into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant