chore: migrate Jest from v27 to v28#7769
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
c3b8645 to
04367f0
Compare
|
@SocketSecurity ignore npm/@types/jsdom@16.2.15 |
974439d to
214fbf4
Compare
|
@SocketSecurity ignore npm/tr46@3.0.0 |
214fbf4 to
f2b315f
Compare
f2b315f to
1b4038e
Compare
1b4038e to
a9cec3a
Compare
a9cec3a to
187c1f4
Compare
187c1f4 to
0c035fc
Compare
Explanation
Update Jest and related testing packages across the monorepo:
The changelogs for the two breaking changes of
ts-jestare here:None of the breaking changes seem to impact us.
This work was earlier started in the PR
References
Checklist
Note
Medium Risk
Broad test-infrastructure upgrade across many packages may surface subtle Jest/ts-jest and environment behavior changes (timers, module resolution, custom environments), potentially causing flaky or failing tests.
Overview
Migrates the monorepo test stack from Jest v27 to v28. This bumps
jest,@types/jest, andts-jestacross packages, and addsjest-environment-jsdom/jest-environment-nodewhere needed.Updates Jest configuration and environment wiring:
moduleNameMappernow forces CommonJS resolutions foruuid(andyamlin package tests) to avoid ESM/bundler issues, and custom environments switch to importing{ TestEnvironment }from the Jest environment packages.Adjusts a handful of tests/helpers for v28 behavior, including replacing
jest.useFakeTimers('modern')usage and updating a timeout-recorder helper to flush microtasks viaPromise.resolve()instead ofjest.runOnlyPendingTimers(). Also updates.depcheckrc.ymlignores for the new Jest environment packages.Written by Cursor Bugbot for commit a9cec3a. This will update automatically on new commits. Configure here.