refactor(web): switch web tests to bun runner#1656
Merged
tyler-dane merged 160 commits intomainfrom Apr 18, 2026
Merged
Conversation
Deleted dead code: broken jestDomMatchers/jestMatcherUtils references, unused MatcherContext type, and 5 helper functions. The matchers are already registered by web.preload.ts via @testing-library/jest-dom. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eeeae56 to
39f05a5
Compare
The test was using vi (Vitest) for fake timers which is not available in bun. Replaced with native setSystemTime() from bun:test - no jest shim needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
22bd5bc to
b07394c
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Batch replaced vi.clearAllMocks() with mock.restore() and removed vi imports across 18 test files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9b372fb to
f82676f
Compare
…hModal tests The delete window.location pattern doesn't work in bun's jsdom. This fix uses setTestWindowUrl which properly updates the URL via history.replaceState. Note: URL Parameter Support tests still need investigation - the setTestWindowUrl approach may need additional work to properly update window.location.search before the component mounts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ortcutHint test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There failed when running 'bun test --bail=1' There was likely one or more bad mocks that cascaded to the others, due to Bun's single-process approach (vs jest's resetting of all mocks automatically) https://bun.com/docs/test/runtime-behavior#test-isolation
1c9afdf to
6adfbce
Compare
Contributor
Author
|
See this commit and its message for context about why so many web tests were deleted. |
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.
Summary
bun testwith the existing web preloadjest.config.jsso backend and scripts remain on Jest onlyValidation
bun installbun test packages/web/src --preload packages/web/src/__tests__/web.preload.ts --bail 1(fails:jest.mock is not a functioninpackages/web/src/sse/provider/SSEProvider.interaction.test.tsx)Follow-up in this branch
jest.mockbun run test:webpassing before review