Skip to content

Latest commit

History

History
33 lines (21 loc) 路 1018 Bytes

UpgradingToJest29.md

File metadata and controls

33 lines (21 loc) 路 1018 Bytes
id title
upgrading-to-jest29
From v28 to v29

Upgrading Jest from v28 to v29? This guide aims to help refactoring your configuration and tests.

:::info

See changelog for the full list of changes.

:::

Compatibility

The supported Node versions are 14.15, 16.10, 18.0 and above.

Snapshot format

As announced in the Jest 28 blog post, Jets 29 has changed the default snapshot formatting to {escapeString: false, printBasicPrototype: false}.

If you want to keep the old behavior, you can set the snapshotFormat property to:

+ snapshotFormat: {
+   escapeString: true,
+   printBasicPrototype: true
+ }

JSDOM upgrade

jest-environment-jsdom has upgraded jsdom from v19 to v20. Due to issues with @types/jsdom, if you extend this environment, you might run into type errors. See DefinitelyTyped/DefinitelyTyped#60999 (reply in thread).