Exclude React-version selection glue from coverage (fix codecov/patch on master) - #516
Merged
Merged
Conversation
The useId/counter selection ternary added in #514 always leaves one arm uncovered in any single coverage run: the run uses React 18/19 (so useId is picked) and the React 16/17 counter fallback is exercised only by the test:legacy smoke suite, which runs without coverage. That partial branch on a new line tripped codecov/patch on master. The fallback function was already v8-ignored; extend the ignore over the selection ternary too. Comment-only change, no logic touched. EmailEditor.tsx branch coverage 94.28% -> 96.96% (the remaining uncovered branch is the pre-existing typeof-window SSR guard, unrelated to any patch).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #516 +/- ##
==========================================
+ Coverage 96.25% 97.43% +1.18%
==========================================
Files 2 2
Lines 80 78 -2
Branches 20 20
==========================================
- Hits 77 76 -1
+ Partials 3 2 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes the red
codecov/patchcheck onmaster(introduced by #514). No build or test was ever broken — this is a coverage-gate artifact.Cause
#514 added the
useId/counter selection ternary for the SSR editor-id fix. In any single coverage run one arm is always unreachable:typeof React.useId === 'function'is true and the counter fallback arm never executes;test:legacysmoke suite, which runs without coverage by design (@testing-library/reactneeds React 18+).So line 33 is a partial branch on a new line →
codecov/patch< 100% → red.Fix
The fallback function was already
v8 ignore-d; this extends the ignore over the selection ternary itself. Comment-only — no logic changes.Verification (local)
EmailEditor.tsxbranch coverage 94.28% → 96.96%; line 33 no longer reported. The only remaining uncovered branch is the pre-existingtypeof windowSSR guard (line 16), which isn't part of any patch, so it won't tripcodecov/patch.npm test(12/12),npm run typecheck,npm run lint— clean.