Skip to content

Upgrading babel-jest 18 to 19

Breaking18.0.0 → 19.0.0Breaking5New13Changed5Fixed16Other2

BreakingUpgrade verdict

5 breaking changes.

  • The mocksPattern setting is gone; remove it from your Jest config.
  • The testPathDirs config option is now called roots.
  • Saved snapshot files now include a version marker, so older snapshot files may need updating.
  • React element snapshots are printed differently, so existing snapshots may fail.
Top 3 of 5 that need code or config changes

Installs 134 packages in all (was 127).

Breaking5
Removes the mocksPattern configuration option, which never worked correctly.
mocksPattern
Renames testPathDirs to roots to avoid confusion when configuring Jest.
testPathDirsroots
Adds a version to snapshots.
Updates printing of React elements to cause fewer changes when props change.
Updates snapshot format to properly escape data.