Skip to content

Commit 9293f4a

Browse files
committed
Document testing cleanup
1 parent d19e57f commit 9293f4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/content/warnings/react-dom-test-utils.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ unmount();
5252
expect(container.innerHTML).toBe('');
5353
```
5454

55-
55+
React Testing Library automatically cleans up rendered trees after each test when your test framework provides an `afterEach` hook. You can call `unmount` yourself when you need to verify cleanup during a test. Unmounting a tree also removes content rendered into a portal by that tree. If your test creates a separate React root, unmount that root separately.
5656

5757
### ReactDOMTestUtils.Simulate {/*reactdomtestutilssimulate*/}
5858

0 commit comments

Comments
 (0)