From ef393b9ec22d01888f3582c5f63917368169fe7b Mon Sep 17 00:00:00 2001 From: Daniel Lo Nigro Date: Fri, 24 Mar 2017 11:59:08 -0700 Subject: [PATCH] Explicitly mention that snapshots should be reviewed (#3203) This paragraph alluded to the fact that snapshots should be reviewed (by mentioning pretty-format), but it should be explicitly mentioned. --- docs/SnapshotTesting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/SnapshotTesting.md b/docs/SnapshotTesting.md index 505d25cda73d..cd648b0cc5e2 100644 --- a/docs/SnapshotTesting.md +++ b/docs/SnapshotTesting.md @@ -42,7 +42,7 @@ exports[`Link renders correctly 1`] = ` `; ``` -The snapshot artifact should be committed alongside code changes. Jest uses [pretty-format](https://github.com/facebook/jest/tree/master/packages/pretty-format) to make snapshots human-readable during code review. On subsequent test runs Jest will simply compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code that should be fixed, or the implementation has changed and the snapshot needs to be updated. +The snapshot artifact should be committed alongside code changes, and reviewed as part of your code review process. Jest uses [pretty-format](https://github.com/facebook/jest/tree/master/packages/pretty-format) to make snapshots human-readable during code review. On subsequent test runs Jest will simply compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code that should be fixed, or the implementation has changed and the snapshot needs to be updated. More information on how snapshot testing works and why we built it can be found on the [release blog post](https://facebook.github.io/jest/blog/2016/07/27/jest-14.html). We recommend reading [this blog post](http://benmccormick.org/2016/09/19/testing-with-jest-snapshots-first-impressions/) to get a good sense of when you should use snapshot testing. We also recommend watching this [this egghead video](https://egghead.io/lessons/javascript-use-jest-s-snapshot-testing-feature?pl=testing-javascript-with-jest-a36c4074) on Snapshot Testing with Jest.