Upgrading babel-jest 28 to 29
Breaking28.1.3 → 29.7.0Breaking11Security1Platform1New59Changed17Fixed97Other17
BreakingUpgrade verdict
11 breaking changes and a platform requirement change and a security fix.
In plain terms
- Snapshot output changes by default: strings are no longer escaped and basic prototypes are not printed.
- jest.mocked now deep-mocks by default, which can change what your mocks return.
- The ANSI conversion plugin is gone; use the separate jest-serializer-ansi-escapes package instead.
- Removes support for `weak-napi` in jest-leak-detector.
Must act Top 5 of 13 that need code or config changes
Node.js requirement changed in 29.0.0-alpha.0: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0 → ^14.15.0 || ^16.10.0 || >=18.0.0.
Installs 139 packages in all (was 140).
What you must change
Breaking11
Makes snapshotFormat default to escapeString: false and printBasicPrototype: false.
snapshotFormatescapeStringprintBasicPrototypeChanges the default jest.mocked helper behavior to deep mocked.
jest.mockedRemoves the ConvertAnsi plugin from pretty-format in favour of jest-serializer-ansi-escapes.
ConvertAnsijest-serializer-ansi-escapesRemoves support for
weak-napi in jest-leak-detector.weak-napiDifferentiates between MatcherContext, MatcherUtils and MatcherState types in expect.
MatcherContextMatcherUtilsMatcherStateRemoves the undocumented collectCoverageOnlyFrom option.
collectCoverageOnlyFromUpgrades jest-environment-jsdom to jsdom@20.
jsdomRefactors Mocked* utility types: MaybeMockedDeep and MaybeMocked become Mocked and MockedShallow; only deep variants of MockedClass, MockedFunction and MockedObject are exported.
MaybeMockedDeepMaybeMockedMockedMockedShallowMockedClassMockedFunctionMockedObjectLets babel find config when updating inline snapshots.
babelRequires
rootDir as an argument to SnapshotState.SnapshotStaterootDirReplaces Bytes and Milliseconds types with number in @jest/test-result and @jest/types.
BytesMillisecondsSecurity1
Updates the semver dependency to get a vulnerability fix.
semverPlatform1
Drops support for Node v12 and v17.