Closed
Description
Apparently cleanup()
is done automatically if the testing framework you're using supports the afterEach
global (like mocha, Jest, and Jasmine):
https://testing-library.com/docs/react-testing-library/api#cleanup
Would this make the following section of the README unnecessary?
Note:
If you read the docs for render you'll see that it's recommended to be used with the cleanup function. This will ensure you don't end up with lots of copies of your component in the same document.
You can use Jest's handy method that runs after each test to do this: afterEach(cleanup).
Metadata
Metadata
Assignees
Labels
No labels