From 64a1204a358c3276376d1ba0f1f364504dc15645 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 17 Jul 2022 22:59:40 +0200 Subject: [PATCH 1/2] chore: add mention of snapshot format change in upgrade guide --- docs/UpgradingToJest29.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/UpgradingToJest29.md b/docs/UpgradingToJest29.md index e589f35880e4..53c130cbdf68 100644 --- a/docs/UpgradingToJest29.md +++ b/docs/UpgradingToJest29.md @@ -14,3 +14,16 @@ See [changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md#2900) fo ## Compatibility The supported Node versions are 14.15, 16.10, 18.0 and above. + +## Snapshot format + +As announced in the [Jest 28 blog post](https://jestjs.io/blog/2022/04/25/jest-28#future), 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: + +```diff ++ snapshotFormat: { ++ escapeString: true, ++ printBasicPrototype: true ++ } +``` From 8244560059eab49cecebb42fb9c7e4aee836126d Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 17 Jul 2022 23:00:29 +0200 Subject: [PATCH 2/2] only path --- docs/UpgradingToJest29.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UpgradingToJest29.md b/docs/UpgradingToJest29.md index 53c130cbdf68..a924b1a2d17e 100644 --- a/docs/UpgradingToJest29.md +++ b/docs/UpgradingToJest29.md @@ -17,7 +17,7 @@ The supported Node versions are 14.15, 16.10, 18.0 and above. ## Snapshot format -As announced in the [Jest 28 blog post](https://jestjs.io/blog/2022/04/25/jest-28#future), Jets 29 has changed the default snapshot formatting to `{escapeString: false, printBasicPrototype: false}`. +As announced in the [Jest 28 blog post](/blog/2022/04/25/jest-28#future), 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: