Skip to content

test: include error detail in token revocation failure test - #405

Draft
parkerbxyz with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-token-revocation-warning
Draft

parkerbxyz with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-token-revocation-warning

Conversation

Copilot AI commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

The post-revoke-token-fail-response snapshot showed Token revocation failed: with nothing after the colon. lib/post.js already includes error.message, but the mocked 401 response had no body, so the message was empty.

Because of that, the snapshot couldn't tell whether the warning included the error. If someone removed ${error.message}, the test would still pass.

This PR gives the mocked 401 a Bad credentials body, which is closer to what GitHub returns for a bad token. The snapshot now asserts:

::warning::Token revocation failed: Bad credentials

I checked this by temporarily removing ${error.message} from lib/post.js, and the test failed as expected.

No source changes are needed. main already masks the token with core.setSecret, so the runner redacts it in the post step.

Co-authored-by: parkerbxyz <17183625+parkerbxyz@users.noreply.github.com>
Copilot AI requested a review from parkerbxyz October 12, 2026 23:55
Revert the redundant redaction in lib/post.js; the token is already
masked via core.setSecret in main. The empty warning came from the
mocked 401 response having no body, so give it one instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61859778-5e53-432d-864c-8eddd0375f86
@parkerbxyz parkerbxyz changed the title [WIP] Fix token revocation warning to include error detail test: include error detail in token revocation failure test Oct 13, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61859778-5e53-432d-864c-8eddd0375f86
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