Skip to content

Upgrading babel-jest 24 to 25

Breaking24.9.0 → 25.5.1Breaking22Platform1New42Changed23Fixed68Other19

BreakingUpgrade verdict

22 breaking changes and a platform requirement change.

  • If your setup used the mapper option in jest-haste-map, it no longer works.
  • The default color of a project's display name now depends on which runner is used, which can change test output.
  • Snapshot matchers now throw errors instead of reporting them through a removed method.
  • Removes re-exports from @jest/core in jest-cli.
Top 4 of 23 that need code or config changes

Node.js requirement changed in 25.1.0: >= 6 → >= 8.3.

Adds graceful-fs ^4.2.4.

Installs 269 packages in all (was 369).

Breaking22
jest-haste-map removes the mapper option.
jest-haste-mapmapper
Sets default display name color based on the runner.
jest-config
Removes the report method and throws matcher errors in jest-snapshot.
report
Removes re-exports from @jest/core in jest-cli.
@jest/core
Removes deprecated exports from jest-util.
jest-util
Supports .mjs config files.
.mjs
Exports jest-diff as an ECMAScript module.
jest-diff
Stops exporting ScriptTransformer from jest-runtime; import it from @jest/transform instead.
ScriptTransformer@jest/transform
Improves jest-snapshot report when the matcher has properties.
Returns transformed code as a string from jest-transform instead of wrapping it in vm.Script.
vm.Script
jest-worker's end() now returns a promise resolving with whether workers exited gracefully.
end()
expect now treats primitives as different from wrappers instantiated with new.
jest-leak-detector uses weak-napi instead of the weak package.
weak-napiweak
Uses less null and undefined in config types in jest-types.
Upgrades to Micromatch v4.
Micromatch
Uses ESM exports in babel-plugin-jest-hoist.
Switches the jest package to ESM exports.
jest
Switches jest-cli to ESM exports.
jest-cli
Upgrades JSDOM from v11 to v15 in jest-environment-jsdom.
jest-environment-jsdom
Upgrades Istanbul dependencies used for code coverage in jest-reporters.
jest-reporters
Switches jest-validate to ESM exports.
jest-validate
Distinguishes an empty string from an internal snapshot that was not written.
Platform1
Drops support for Node 6.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: export { loadPartialConfig } from '@babel/core'
  • added: const transformer: BabelJestTransformer & { createTransformer: (options?: TransformOptions) => BabelJestTransformer }
  • added: export = transformer
  • added: export { loadPartialConfig } from '@babel/core'