Skip to content

Commit 32aa938

Browse files
committed
Instructs user to call cleanup() themselves
1 parent d603d3f commit 32aa938

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

docs/preact-testing-library/api.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Unmounts the component from the container and destroys the container.
5454

5555
> This is called automatically if your testing framework (such as mocha, Jest or
5656
> Jasmine) injects a global `afterEach()` function into the testing environment.
57+
> If not, you will need to call `cleanup()` after each test.
5758
5859
If you'd like to disable this then set `process.env.PTL_SKIP_AUTO_CLEANUP` to
5960
true when running your tests.

docs/react-testing-library/api.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ Unmounts React trees that were mounted with [render](#render).
291291
292292
> This is called automatically if your testing framework (such as mocha, Jest or
293293
> Jasmine) injects a global `afterEach()` function into the testing environment.
294+
> If not, you will need to call `cleanup()` after each test.
294295
295296
For example, if you're using the [ava](https://github.com/avajs/ava) testing
296297
framework, then you would need to use the `test.afterEach` hook like so:

docs/svelte-testing-library/api.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const {results} = render(YourComponent, {myProp: 'value'})
7272

7373
> This is called automatically if your testing framework (such as mocha, Jest or
7474
> Jasmine) injects a global `afterEach()` function into the testing environment.
75+
> If not, you will need to call `cleanup()` after each test.
7576
7677
Unmounts the component from the container and destroys the container.
7778

docs/vue-testing-library/api.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ Unmounts Vue trees that were mounted with
234234

235235
> This is called automatically if your testing framework (such as mocha, Jest or
236236
> Jasmine) injects a global `afterEach()` function into the testing environment.
237+
> If not, you will need to call `cleanup()` after each test.
237238
238239
Failing to call `cleanup` when you've called `render` could result in a memory
239240
leak and tests which are not idempotent (which can lead to difficult to debug

0 commit comments

Comments
 (0)