You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- **NB:** A more consistent way of selecting elements is using a [data attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*) that is specifically defined for testing purposes. Using _react-testing-library_, we can leverage the [getByTestId](https://testing-library.com/docs/queries/bytestid/) method to select elements with a specified _data-testid_ attribute. -->
@@ -650,7 +650,7 @@ test('<NoteForm /> updates parent state and calls onSubmit', async() => {
650
650
})
651
651
```
652
652
653
-
In the middle of running the tests, the following is printed
653
+
<!--In the middle of running the tests, the following is printed-->
654
654
在运行测试的过程中,打印以下内容
655
655
656
656
```
@@ -911,8 +911,8 @@ HTML 报告将生成到<i>coverage</i>目录。
911
911
912
912
#### 5.13: Blog List Tests, step 1
913
913
914
-
Make a test, which checks that the component displaying a blog renders the blog's title and author, but does not render its URL or number of likes by default.
<!--Make a test, which checks that the component displaying a blog renders the blog's title and author, but does not render its URL or number of likes by default.-->
<!-- The fundamental principle is to compare the HTML code defined by the component after it has changed to the HTML code that existed before it was changed. -->
958
958
基本原则是将组件更改后定义的 HTML 代码与更改前存在的 HTML 代码进行比较。
959
959
960
-
<!-- If the snapshot notices some change in the HTML defined by the component, then either it is new functionality or a "bug" caused by accident. Snapshot tests notify the developer if the HTML code of the component changes. The developer has to tell Jest if the change was desired or undesired. If the change to the HTML code is unexpected, it strongly implies a bug, and the developer can become aware of these potential issues easily thanks to snapshot testing. -->
961
-
如果快照注意到组件定义的 HTML 中发生了一些变化,那么它要么是新功能,要么是意外造成的“错误”。快照测试会通知开发人员组件的 HTML 代码是否发生变化。开发人员必须告诉 Jest 更改是需要的还是不需要的。如果对 HTML 代码的更改是意外的,那么它强烈暗示存在错误,并且开发人员可以轻松地通过快照测试了解这些潜在问题。
960
+
<!-- If the snapshot notices some change in the HTML defined by the component, then either it is new functionality or a "bug" caused by accident. Snapshot tests notify the developer if the HTML code of the component changes. The developer has to tell Vitest if the change was desired or undesired. If the change to the HTML code is unexpected, it strongly implies a bug, and the developer can become aware of these potential issues easily thanks to snapshot testing. -->
961
+
如果快照注意到组件定义的 HTML 中发生了一些变化,那么它要么是新功能,要么是意外造成的“错误”。快照测试会通知开发人员组件的 HTML 代码是否发生变化。开发人员必须告诉 Vitest 更改是需要的还是不需要的。如果对 HTML 代码的更改是意外的,那么它强烈暗示存在错误,并且开发人员可以轻松地通过快照测试了解这些潜在问题。
0 commit comments