Skip to content

test(downgrader): cover a plain branch in a tagged union beside a discriminator - #151

Merged
dinwwwh merged 1 commit into
mainfrom
claude/project-thread-e6daon
Oct 28, 2026
Merged

dinwwwh merged 1 commit into
mainfrom
claude/project-thread-e6daon

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Oct 28, 2026

Copy link
Copy Markdown
Member

Requested by dinwwwh · project thread

Test-only. Stryker on main (a9ea06d, after #150) found that in convertTaggedBranch, the mutant ref !== undefined && → true && survives: no test had a branch without a $ref in 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 check passes.


Generated by Claude Code

…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
@dinwwwh dinwwwh self-assigned this Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing claude/project-thread-e6daon (bff0804) with main (a9ea06d)

Open in CodSpeed

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 the oneOf/anyOf input and the expected output of keeps 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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@dinwwwh
dinwwwh merged commit 557363d into main Oct 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants