File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,11 @@ const {results} = render(<YourComponent />, {options})
52
52
53
53
Unmounts the component from the container and destroys the container.
54
54
55
- 📝 When you import anything from the library, this automatically runs after each
56
- test. If you'd like to disable this then set ` process.env.PTL_SKIP_AUTO_CLEANUP `
57
- to true when running your tests.
55
+ > This is called automatically if your testing framework (such as mocha, Jest or
56
+ > Jasmine) injects a global ` afterEach() ` function into the testing environment.
57
+
58
+ If you'd like to disable this then set ` process.env.PTL_SKIP_AUTO_CLEANUP ` to
59
+ true when running your tests.
58
60
59
61
``` jsx
60
62
import {render , cleanup } from ' @testing-library/preact'
Original file line number Diff line number Diff line change @@ -232,9 +232,8 @@ See a working example of `update` in the
232
232
Unmounts Vue trees that were mounted with
233
233
[ render] ( #rendercomponent-options-callback ) .
234
234
235
- > If you are using an environment that supports ` afterEach ` hook (as in Jest),
236
- > there's no need to call ` cleanup ` manually. Vue Testing Library handles it for
237
- > you.
235
+ > This is called automatically if your testing framework (such as mocha, Jest or
236
+ > Jasmine) injects a global ` afterEach() ` function into the testing environment.
238
237
239
238
Failing to call ` cleanup ` when you've called ` render ` could result in a memory
240
239
leak and tests which are not idempotent (which can lead to difficult to debug
You can’t perform that action at this time.
0 commit comments