From 41f4e6fe43d4b44452e4251e2c80f6deb91b7eb2 Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Jun 2021 09:32:13 +0100 Subject: [PATCH 1/9] reference prettier in inline snapshots section See #8467. --- docs/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/SnapshotTesting.md b/docs/SnapshotTesting.md index 1d7947fc7f75..b676b19c409c 100644 --- a/docs/SnapshotTesting.md +++ b/docs/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +The writing of snapshots into your source code is performed via [prettier](https://www.npmjs.com/package/prettier). If you're not already using it in your project but want to use inline snapshots, you'll just need to install it under your `devDependencies`. + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From e7816a0bf351bcf1b3f99fbc4cc7c6553b047241 Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Jun 2021 13:53:19 +0100 Subject: [PATCH 2/9] add prettier note to 25.x doc version --- website/versioned_docs/version-25.x/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-25.x/SnapshotTesting.md b/website/versioned_docs/version-25.x/SnapshotTesting.md index 6907cbdea53a..9d3492d20ad7 100644 --- a/website/versioned_docs/version-25.x/SnapshotTesting.md +++ b/website/versioned_docs/version-25.x/SnapshotTesting.md @@ -138,6 +138,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +The writing of snapshots into your source code is performed via [prettier](https://www.npmjs.com/package/prettier). If you're not already using it in your project but want to use inline snapshots, you'll just need to install it under your `devDependencies`. + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From 14dc56663fadbbe9c086737f04c80041ec8285a1 Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Jun 2021 13:53:54 +0100 Subject: [PATCH 3/9] add prettier note to 26.x doc version --- website/versioned_docs/version-26.x/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-26.x/SnapshotTesting.md b/website/versioned_docs/version-26.x/SnapshotTesting.md index 6907cbdea53a..9d3492d20ad7 100644 --- a/website/versioned_docs/version-26.x/SnapshotTesting.md +++ b/website/versioned_docs/version-26.x/SnapshotTesting.md @@ -138,6 +138,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +The writing of snapshots into your source code is performed via [prettier](https://www.npmjs.com/package/prettier). If you're not already using it in your project but want to use inline snapshots, you'll just need to install it under your `devDependencies`. + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From c39a4cf1bccff1e636f78e693ca0a9e29fd8c1de Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Jun 2021 13:57:38 +0100 Subject: [PATCH 4/9] rework note now that prettier is optional --- docs/SnapshotTesting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/SnapshotTesting.md b/docs/SnapshotTesting.md index b676b19c409c..56b3b7cdadc1 100644 --- a/docs/SnapshotTesting.md +++ b/docs/SnapshotTesting.md @@ -134,7 +134,7 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. -The writing of snapshots into your source code is performed via [prettier](https://www.npmjs.com/package/prettier). If you're not already using it in your project but want to use inline snapshots, you'll just need to install it under your `devDependencies`. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). ### Property Matchers From 9cd0a6895a56653ebdb088b9f6140c08667781db Mon Sep 17 00:00:00 2001 From: David Goss Date: Mon, 14 Jun 2021 13:58:26 +0100 Subject: [PATCH 5/9] add optional-prettier note to 27.x version too --- website/versioned_docs/version-27.0/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-27.0/SnapshotTesting.md b/website/versioned_docs/version-27.0/SnapshotTesting.md index 1d7947fc7f75..56b3b7cdadc1 100644 --- a/website/versioned_docs/version-27.0/SnapshotTesting.md +++ b/website/versioned_docs/version-27.0/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From f5cc499832dcbcc0c79ceb30015fbf929d76a501 Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 23 Feb 2022 09:40:26 +0000 Subject: [PATCH 6/9] update 27.1 docs --- website/versioned_docs/version-27.1/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-27.1/SnapshotTesting.md b/website/versioned_docs/version-27.1/SnapshotTesting.md index 004ace393d13..385b29abae3f 100644 --- a/website/versioned_docs/version-27.1/SnapshotTesting.md +++ b/website/versioned_docs/version-27.1/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From 3890c12c69e6f8b091134d66f0c70d9419e5a352 Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 23 Feb 2022 09:40:53 +0000 Subject: [PATCH 7/9] update 27.2 docs --- website/versioned_docs/version-27.2/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-27.2/SnapshotTesting.md b/website/versioned_docs/version-27.2/SnapshotTesting.md index 004ace393d13..385b29abae3f 100644 --- a/website/versioned_docs/version-27.2/SnapshotTesting.md +++ b/website/versioned_docs/version-27.2/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From d16686e088d4cab9ad12e4027b893d599f0156fc Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 23 Feb 2022 09:41:19 +0000 Subject: [PATCH 8/9] update 27.4 docs --- website/versioned_docs/version-27.4/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-27.4/SnapshotTesting.md b/website/versioned_docs/version-27.4/SnapshotTesting.md index 004ace393d13..385b29abae3f 100644 --- a/website/versioned_docs/version-27.4/SnapshotTesting.md +++ b/website/versioned_docs/version-27.4/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: From 4e0484052f0b784c3caaedcb5dc8b50b864a3abc Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 23 Feb 2022 09:41:43 +0000 Subject: [PATCH 9/9] update 27.5 docs --- website/versioned_docs/version-27.5/SnapshotTesting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/versioned_docs/version-27.5/SnapshotTesting.md b/website/versioned_docs/version-27.5/SnapshotTesting.md index 004ace393d13..385b29abae3f 100644 --- a/website/versioned_docs/version-27.5/SnapshotTesting.md +++ b/website/versioned_docs/version-27.5/SnapshotTesting.md @@ -134,6 +134,8 @@ it('renders correctly', () => { That's all there is to it! You can even update the snapshots with `--updateSnapshot` or using the `u` key in `--watch` mode. +By default, Jest handles the writing of snapshots into your source code. However, if you're using [prettier](https://www.npmjs.com/package/prettier) in your project, Jest will detect this and delegate the work to prettier instead (including honoring your configuration). + ### Property Matchers Often there are fields in the object you want to snapshot which are generated (like IDs and Dates). If you try to snapshot these objects, they will force the snapshot to fail on every run: