Repository navigation
test(downgrader): cover a plain branch in a tagged union beside a discriminator - #151
Merged
Merged
Conversation
…criminator Adds a branch holding only annotations, with no `$ref`, to the tagged union test, so the `ref !== undefined` check in `convertTaggedBranch` is tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VVaw7RX2ewSBmP9PHTZdKD
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — test-only change to the downgrader's 3.1→3.0 suite.
- Third branch in a tagged union — adds
{ description: 'Any other block' }, a$ref-less, annotation-only branch, to both theoneOf/anyOfinput and the expected output ofkeeps a $ref beside only annotations bare in a union beside a discriminator.
I verified the stated coverage: the targeted test passes on the head, and re-applying the mutant ref !== undefined && → true && in convertTaggedBranch (packages/downgrader/src/v3.1-to-v3.0.ts:341) makes it fail with the exact Cannot read properties of undefined (reading 'includes') error. uncheck passes on the file.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
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.

Requested by dinwwwh · project thread
Test-only. Stryker on main (a9ea06d, after #150) found that in
convertTaggedBranch, the mutantref !== undefined &&→true &&survives: no test had a branch without a$refin a union beside a discriminator. With the mutant, a branch holding only annotations, such as{ description: ... }, throws (Cannot read properties of undefined (reading 'includes')).This adds
{ description: 'Any other block' }as a third branch in the test "keeps a $ref beside only annotations bare in a union beside a discriminator". It passes on main and fails on the mutant.pnpm run checkpasses.Generated by Claude Code