Repository navigation
test(auth): cover the getErrorDetails fallback branches for string, empty-object and bare Error rejections - #194
Merged
Conversation
…mpty-object and bare Error rejections
checkOrgMember, checkCollaborator and checkIssueComments route every
caught error through getErrorDetails, but only the { status, message }
shape was exercised. Add one rejection per fallback branch: a plain
string (non-object), an empty object (no status, no message) and a bare
Error (no status), asserting the exact core.warning text.
Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
Contributor
|
Please add a kind label with |
This was referenced Sep 27, 2026
This was referenced Sep 28, 2026
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.
Test Improvement
Adds three tests to
__tests__/utils/auth.test.ts— the only file touched — covering the privategetErrorDetailshelper insrc/utils/auth.ts(lines 12–22), which everycheckOrgMember/checkCollaborator/checkIssueCommentscatch routes through:checkOrgMemberrejecting with a plain string →status=unknown, message=socket hang up(non-object branch, line 22)checkCollaboratorrejecting with{}→status=unknown, message=[object Object](no status, no string message)checkIssueCommentsrejecting with a bareError('network down')→status=unknown, message=network down(no status)Each asserts the exact
core.warningtext so a formatting regression in the fallback path is caught.Result on this branch:
getErrorDetailsis 100% line/branch covered; the only remaining uncovered lines inauth.ts(179, 208, 215, 222) are dead defensive catches around functions that never reject, as noted in the issue.Disjoint from every open test PR (#173, #175, #177, #179, #181, #183, #185, #187, #190, #192) — none touch
auth.test.tsorutils/auth.ts.Verification:
npx vitest run __tests__/utils/auth.test.ts→ 22 passed;npx eslint __tests__/utils/auth.test.tsclean.Related Issue
Closes #193
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88