Repository navigation
chore(coverage): v8-ignore getErrorDetails' bundle-unreachable object folds - #587
Merged
Merged
Conversation
… folds @octokit/request wraps every rejection the bundle can see in a RequestError carrying a numeric status and a string message, so the status-less and message-less object arms of getErrorDetails (auth.ts:15-17) cannot be reached through dist/index.js; auth.test.ts drives them. Ignore each statement as a whole: an arm-level hint leaves the && short-circuit branch reported. coverage-e2e now names only the documented phantom branch, which moved from auth.ts:220 to :225. Supersedes #553, which reached these arms only by patching globalThis.fetch in the bundle child to throw a plain object from response.status. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
Member
Author
|
/kind cleanup |
Closed
11 of 22 tasks
3 tasks
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.
Description
getErrorDetails(src/utils/auth.ts:15-17) has two defensive folds — an object withoutstatus→'unknown', and an object without a stringmessage→String(error)— thatcoverage-e2ehas named as the only non-phantom uncovered branches inauth.ts. They cannot be reached throughdist/index.js:@octokit/requestwraps every rejection the bundle can see in aRequestError, which always carries a numericstatusand a stringmessage.__tests__/utils/auth.test.tsdrives both arms with hand-built objects.This marks each statement
/* v8 ignore next */with the same rationale style as #537/#544/#549. The hint is statement-level rather than arm-level because an arm-level hint on themessageternary leaves the&&short-circuit branch reported (verified). The production code is unchanged.The documented phantom branch in
docs/contributing.mdmoved fromauth.ts:220to:225with the added lines; the reference is updated.Supersedes #553, which reached these arms only by preloading a
.cjsinto the bundle child that patchesglobalThis.fetchto throw a plain object fromresponse.status— a path no real client produces.Refs #507, #170 (folded finding).
Testing
npm run build && npm run lint— passes (one pre-existingjsdoc/check-param-nameswarning atcc.ts:81, unrelated)npm run test:coverage— 2333 passed, 75 skipped; 99.92 / 99.34 / 100 / 99.91npm run test:coverage:e2e— 86 files / 528 tests passed; 100 / 99.58 / 100 / 100 (was 99.46 branches);auth.tsnow lists only line 225, confirmed as the phantom (BRDA:225,10,1,-44incoverage-e2e/lcov.info)Checklist
npm run allto lint and build my code (ranbuild,lint,packand both coverage suites individually)npm run packand committeddist//kind cleanup