-
Notifications
You must be signed in to change notification settings - Fork 0
feat(auth): tolerate AUTH_STORE_READ_FAILED in logout --user (2/4) #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,4 +246,19 @@ describe('attachStatusCommand', () => { | |
| code: 'ACCOUNT_NOT_FOUND', | ||
| }) | ||
| }) | ||
|
|
||
| it('surfaces AUTH_STORE_READ_FAILED end-to-end (does not collapse to ACCOUNT_NOT_FOUND)', async () => { | ||
|
scottlovegrove marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] This test successfully asserts error propagation for
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Held — earlier in this PR's review history we explicitly dropped the analogous |
||
| const thrown = new CliError('AUTH_STORE_READ_FAILED', 'keyring offline') | ||
| const built = buildStore() | ||
| built.activeSpy.mockRejectedValueOnce(thrown) | ||
| const { program } = build({}, built.store) | ||
|
|
||
| // Assert the exact thrown instance bubbles through unchanged — a | ||
| // future refactor that recreates the error with the same code | ||
| // (losing the original `cause` / stack) would still satisfy an | ||
| // `objectContaining({ code })` check. | ||
| await expect( | ||
| program.parseAsync(['node', 'cli', 'auth', 'status', '--user', 'me']), | ||
| ).rejects.toBe(thrown) | ||
| }) | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.