Skip to content

test: cover updater error parity#86

Closed
travis-hoover-glean wants to merge 1 commit into
mainfrom
test/updater-error-parity
Closed

test: cover updater error parity#86
travis-hoover-glean wants to merge 1 commit into
mainfrom
test/updater-error-parity

Conversation

@travis-hoover-glean

Copy link
Copy Markdown
Contributor

Adds TypeScript characterization tests for updater edge cases: malformed version metadata and Windows install failures should not re-exec after a failed replacement/pending write.\n\nTested: npm test -- --run src/updater.spec.ts

@travis-hoover-glean travis-hoover-glean requested a review from a team as a code owner June 4, 2026 21:57
Comment thread src/updater.spec.ts

describe('checkForUpdate error behavior', () => {
it('throws when version metadata omits version', async () => {
;(fetch as Mock).mockResolvedValueOnce(okJson({}))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1/5 (nit, non-blocking)

what's with the leading ; in these test bodies?

Comment thread src/updater.spec.ts
})

it('returns false and does not re-exec when replacing a renamed Windows binary fails', async () => {
;(fetch as Mock).mockResolvedValueOnce(okJson({ version: '9.9.9' })).mockResolvedValueOnce(okBinary())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1/5 (nit, non-blocking)

we have a whole block of mocks at the top of this file to avoid all this typecasting in test bodies. Consider adding a mockFetch there

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