Skip to content

Commit d19e57f

Browse files
committed
Document testing cleanup
1 parent 0821e7d commit d19e57f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ import {render} from '@testing-library/react';
4343

4444
render(<Component />);
4545
```
46+
`render` returns an `unmount` function and the rendered container:
47+
48+
```js
49+
const {unmount, container} = render(<Component />);
50+
51+
unmount();
52+
expect(container.innerHTML).toBe('');
53+
```
54+
55+
4656

4757
### ReactDOMTestUtils.Simulate {/*reactdomtestutilssimulate*/}
4858

0 commit comments

Comments
 (0)