test(fix,report): cover notes content, info-severity handling, multi-file fix, and info label#17
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Four specific code paths in
fix.tsandreport.tshad no test coverage. These are not hypothetical:outcome.notesis part of theFixOutcomepublic type (returned to callers and shown in the CLI report), theinfo-severity bypass inapplyFixesis a deliberate behavioral contract, and theinfolabel branch inreportTextis operator-facing output. Pinning them with tests prevents silent regressions as the codebase evolves toward v1.0.What
test/fix.test.ts: three new casesoutcome.notesis populated and contains the rule name and corrected name after aname-driftfixinfo-severity diagnostics are silently ignored (not counted asskipped) - this is the intentional contract inapplyFixesname-drifton two different files in a single call rewrites both correctlytest/report.test.ts: one new caseinfo-severity diagnostic line renders with the"info"label (thepc.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
Generated by Claude Code