Introduction To React Testing: Changes to the suggestion of calling render in beforeEach #29381
Open
2 of 3 tasks
Labels
Content: React
Involves the React course
Status: Help Wanted
This issue can be assigned to other contributors
Type: Good First Issue
Good for beginner contributors
Checks
Describe your suggestion
In the last paragraph of the section,
Simulating user events
the lesson implicitly suggests the use ofbeforeEach
when writing multiple tests for a component because each of them require therender
method to be called every time.The linked docs on introduction to user events on RTL website, and the lesson that follows this one, on the other hand, both discourage the use of invoking
render
inbeforeEach
with given explanations, and instead suggest using a setup function if needed.With that in mind, I think it would be a good idea to replace the following line with one about setup functions.
Something like this perhaps.
Or we could remove it altogether.
Path
Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-react-new-introduction-to-react-testing
(Optional) Discord Name
ginned
(Optional) Additional Comments
No response
The text was updated successfully, but these errors were encountered: