docs(cn): translate jest/docs/SnapshotTesting.md#16
Open
zzllover wants to merge 1 commit intodocschina:cnfrom
Open
docs(cn): translate jest/docs/SnapshotTesting.md#16zzllover wants to merge 1 commit intodocschina:cnfrom
zzllover wants to merge 1 commit intodocschina:cnfrom
Conversation
lcxfs1991
requested changes
Nov 12, 2020
| @@ -3,13 +3,13 @@ id: snapshot-testing | |||
| title: Snapshot Testing | |||
|  | ||
|
|
||
| Since we just updated our component to point to a different address, it's reasonable to expect changes in the snapshot for this component. Our snapshot test case is failing because the snapshot for our updated component no longer matches the snapshot artifact for this test case. | ||
| 由于我们刚刚将组件更新为指向一个不同的链接地址,因此能够合理的预期此组件快照的更改。我们的快照测试示例测试未通过,原因在于已更改组件的快照不再与测试用例中的快照工件相匹配。 |
| 由于我们刚刚将组件更新为指向一个不同的链接地址,因此能够合理的预期此组件快照的更改。我们的快照测试示例测试未通过,原因在于已更改组件的快照不再与测试用例中的快照工件相匹配。 | ||
|
|
||
| To resolve this, we will need to update our snapshot artifacts. You can run Jest with a flag that will tell it to re-generate snapshots: | ||
| 为解决此问题,我们将需要更新测试用例中的快照工件。你可以运行Jest,并附带一个标志参数,它表示重新生成快照。 |
| 你可以通过克隆[快照用例](https://github.com/facebook/jest/tree/master/examples/snapshot), 修改`Link`组件并运行Jest来测试这一功能。 | ||
|
|
||
| ### Interactive Snapshot Mode | ||
| ### 交互性快照模式 |
|  | ||
|
|
||
| Once you enter Interactive Snapshot Mode, Jest will step you through the failed snapshots one test at a time and give you the opportunity to review the failed output. | ||
| 进入交互性快照模式后,Jest将在一次测试中逐步引导你通过失败的快照,并给予你观察错误的日志输出。 |
| @@ -268,6 +269,7 @@ exports[`<UserName /> should render Alan Turing`] = ` | |||
| ``` | |||
|
|
|||
| Since the later describes exactly what's expected in the output, it's more clear to see when it's wrong: | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan