web: upgrade Jest to v30#9253
Closed
kevinortiz43 wants to merge 2 commits into
Closed
Conversation
Jest 30 removes the alias matchers; switch to the canonical spellings now so this lands and stays green on jest 29 before the version bump. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump jest, jest-environment-jsdom, and @types/jest to v30 (see https://jestjs.io/docs/upgrading-to-jest30). Fix the resulting fallout: jest.config.ts needs the explicit next/jest.js extension under jest 30's stricter TS config resolution, and two test files redefined `window`/ `window.location` in setup/teardown, which jsdom 26 now makes non-configurable — replaced with window.history.pushState and dropped the no-op window restore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
MobileInstall the Dev Tool (iOS via TestFlight, iOS Simulator, or Android .apk) here. Scan the QR with your phone camera, or tap Open in Dev Tool on the device, to open this branch in the installed Dev Tool dev client.
Deep linksiOS Android Web (Vercel)View the Vercel web preview for this branch. Backend
Other
|
Member
|
Hey @kevinortiz43 - @darrenvong already did this ticket before you in #9252 FYI. I've approved that one so probably best to close this one. |
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.


Upgrades
app/webfrom Jest 29 to Jest 30, following the official Jest 30 migration guide referenced in the issue. Web-only — mobile's Jest is pinned by the Expo SDK and is out of scope.Done as 2 commits: first the backward-compatible test refactors (green on Jest 29, so it's a clean bisect point), then the version bump and its fallout.
toBeCalled/toBeCalledTimes/toBeCalledWith→toHaveBeenCalled*across 12 test files (23 sites). NotoThrowErrorsites existed.jest.SpyInstance→jest.Spied<…>(type removed in v30) infeatures/analytics/provider.test.tsx.jest^29.7.0→^30.4.2,jest-environment-jsdom^29.7.0→^30.4.1,@types/jest^29.5.14→^30.0.0.babel-jest/jest-junitalready compatible.jest-environment-jsdom30): JSDOM 26 makes globalwindow/window.locationnon-configurable, so two tests that redefined them viaObject.definePropertynow threw. Fixed by removing a deadwindow-restore inPushNotificationSettings.test.tsxand switchingprovider.test.tsxtohistory.pushState(JSDOM's supported navigation API). Alsojest.config.ts:next/jest→next/jest.jsfor v30's stricter ESM resolution.Closes #6978
Testing
tsc --noEmitclean (verified the guide's strictertoHaveBeenCalledWithtype inference surfaced no new errors).yarn testsuite on Jest 30: 881 pass / 3 skip; the only failures are two pre-existing parallel-load flakes (MarkdownInput— file untouched here;EditProfilePage— passes with--runInBand), which fail identically ondevelop. Zero new regressions.jest-junitstill emits valid JUnit XML for CI.Web frontend checklist
For maintainers
This PR was created with the Couchers PR skill.