Repository navigation
test(downgrader): cover the cut-$ref reset, writeOnly and $ref tags, and repeated keywords beside properties - #330
Conversation
…and repeated keywords beside properties Stryker on 94c60c7 leaves 77 mutants alive where 0.5.0 left 70. Seven of the new ones are untested branches from #313, #314 and #318: - cutHolders.clear() removed: a $ref object cut in one call still tells no oneOf branch apart in the next. - follow's check for a $ref into a target being inlined removed: a $ref to a component whose own $ref into that target is cut only later keeps a oneOf whose branches now overlap. - isOneWay ignoring writeOnly, or not following a $ref to the tag. - repeats(): a repeated additionalProperties beside the same properties, and another keyword beside different properties. - mayRepeatUnseen counting null as an object. Each of these mutants now fails a test. No source change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVaw7RYWCsn8myBE4Rncuq
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — test-only PR adding coverage in packages/downgrader/tests/v3.1-to-v3.0.test.ts for ten mutants Stryker leaves alive on main (eight from #313/#314/#318 plus the two equivalent ones). No src/ change.
cutHolders.clear()reset — a$refobject cut at recursion in onedowngradeSchemaV31ToV30call must not suppress branch-telling in the next call.follow's inlining cut — a$refto a component whose own$refback into the target is cut only after its other keywords convert still forces theoneOftoanyOf.isOneWaywriteOnly/$reffollow — aoneOftagged only bywriteOnly, and one tagged via$refs toreadOnlyconsts, each becomeanyOf; a$refloop holds neither keyword.repeats()additionalPropertiesclause — a repeatedadditionalPropertiesbeside the same (no) properties merges; a repeateddescriptionbeside differing properties merges too.mayRepeatUnseennull handling — aoneOfof literals whose enum holdsnullmerges.
I verified the coverage claim independently: applying each of nine targeted mutations to src/v3.1-to-v3.0.ts and re-running the corresponding test kills all nine (source restored byte-identical). Full suite (362 tests) and uncheck (oxlint/oxfmt/tsc) pass on the tree.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Requested by dinwwwh · project thread
What
Test-only. Stryker on main (94c60c7) leaves 77 of 2,511 mutants alive, where 0.5.0 left 70. Of the 10 new survivors, 8 are untested branches added by #313, #314 and #318 (the other 2, the
converting: []initial value andisOneWay's finalreturn false, are equivalent):cutHolders.clear()removed (#313)$refobject cut at recursion in one call still told nooneOfbranch apart in the next call.follow's check for a$refinto a target being inlined removed (#313's surroundings)$refto a component whose own$refinto that target is cut only after the component's other keywords convert. Without the check, theoneOfstays although its branch{ allOf: [{}] }now overlaps the other one, so 3.0 rejects{ tag: "u" }, which 3.1 accepts.isOneWayignoringwriteOnly(2 mutants), or not following a$ref(#318)oneOftagged only bywriteOnlytags, and one tagged by$refs toreadOnlyconsts, both becomeanyOf.repeats()'sadditionalPropertiesclause (3 mutants, #314)additionalPropertiesbeside the same (no) properties merges, and a repeateddescriptionbeside different properties merges too.mayRepeatUnseencountingnullas an objectoneOfof literals where one enum holdsnullmerges.I checked each mutant by hand: each now fails a test, and the unmutated code passes.
Checks
pnpm run checkandpnpm test(303 tests) pass. No source change, so coverage stays at 100%.Generated by Claude Code