Upgrading babel-jest 21 to 22
Breaking21.2.0 → 22.4.4Breaking6Platform1Deprecated1New39Changed13Fixed64Other26
BreakingUpgrade verdict
6 breaking changes and a platform requirement change.
In plain terms
- The toBe matcher now uses Object.is, so some edge cases like NaN and -0 compare differently.
- The simulated browser used by tests is now a newer version, so some DOM behavior may differ.
- Custom test environments must use the new teardown method instead of dispose.
- Snapshot file keys now combine the test name and snapshot name, so existing snapshots may need updating.
Must act Top 5 of 8 that need code or config changes
What you must change
Breaking6
Replaces identity equality with Object.is in the toBe matcher in expect.
toBeObject.isUpgrades jest-environment-jsdom to JSDOM 11, which changes the DOM implementation behavior.
jest-environment-jsdomAdds Async Test Environment APIs and renames dispose to teardown in test environments.
disposeteardownConcatenates the test name and snapshot name in jest-snapshot, changing snapshot keys.
jest-snapshotjest-cli now fails when no tests are found.
jest-cliAdds a serializer for
jest.fn so jest mocks can be snapshotted, changing snapshot output.jest.fnPlatform1
Drops support for Node.js version 4.
Deprecations to plan for
Deprecated1
Deprecates the mapCoverage option.
jest-runtimemapCoverage