$ the-wire · showcase
Jest 30.5 and React test upgrades ship
By RepoJournal · Filed · About Meta
Jest 30.5.0 ships with deep changes to jest-runtime, jest-resolve, and jest-haste-map, and React's test suite moves to Jest 30.4 with a jsdom bump.
Jest 30.5.0 is a big release touching `jest-runtime`, `jest-resolve`, and `jest-haste-map`, and the maintainer warns regressions are possible, so verify your suite after upgrading [1]. React's test suite also bumps to Jest 30.4, and the `resolutions` pin holding jsdom at 22.1.0 is removed, so the test environment now runs the jsdom version `jest-environment-jsdom` declares (26.1.0) [2]. This is a breaking change for any test using the deleted matcher aliases; React's suite now uses `toHaveBeenCalled*` instead of `toBeCalled*` and `toThrow` instead of `toThrowError`, so update your matchers accordingly [2]. React Native removes the unimplemented `sendIntent` method from `RCTLinkingManager`; since `Linking.sendIntent()` already rejected with 'Unsupported' on non-Android platforms, the native method was unreachable and only logged 'Not implemented' [3]. React Native also defers the pull model's synchronous mount batch until the root view is attached, fixing two crashes that occurred when a `ViewState` had a null `view` field [4]. The maintainer of Jest dedicated the 30.5.0 release to the memory of King Harald V of Norway [1].
Action items
- → Upgrade to Jest 30.5.0 and run your full suite, watching for regressions in runtime, resolve, and haste-map behavior facebook/jest [immediate]
- → Replace deprecated Jest matcher aliases (toBeCalled*, toThrowError) in your React test suites before upgrading to Jest 30 facebook/react [immediate]
- → Monitor React Native pull model behavior for changes in mount timing after the sync mount batch deferral facebook/react-native [monitor]
References
- [1] v30.5.0 ↗ facebook/jest
- [2] [test] Bump Jest to 30.4 ↗ facebook/react
- [3] Remove unimplemented sendIntent from RCTLinkingManager (#58154) ↗ facebook/react-native
- [4] Defer the pull model's synchronous mount batch until the root view is attached (#58152) ↗ facebook/react-native