File tree 4 files changed +4
-0
lines changed
4 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ Unmounts the component from the container and destroys the container.
54
54
55
55
> This is called automatically if your testing framework (such as mocha, Jest or
56
56
> Jasmine) injects a global ` afterEach() ` function into the testing environment.
57
+ > If not, you will need to call ` cleanup() ` after each test.
57
58
58
59
If you'd like to disable this then set ` process.env.PTL_SKIP_AUTO_CLEANUP ` to
59
60
true when running your tests.
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ Unmounts React trees that were mounted with [render](#render).
291
291
292
292
> This is called automatically if your testing framework (such as mocha, Jest or
293
293
> Jasmine) injects a global ` afterEach ()` function into the testing environment.
294
+ > If not, you will need to call ` cleanup ()` after each test.
294
295
295
296
For example, if you're using the [ava](https://github.com/avajs/ava) testing
296
297
framework, then you would need to use the ` test .afterEach ` hook like so:
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ const {results} = render(YourComponent, {myProp: 'value'})
72
72
73
73
> This is called automatically if your testing framework (such as mocha, Jest or
74
74
> Jasmine) injects a global ` afterEach() ` function into the testing environment.
75
+ > If not, you will need to call ` cleanup() ` after each test.
75
76
76
77
Unmounts the component from the container and destroys the container.
77
78
Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ Unmounts Vue trees that were mounted with
234
234
235
235
> This is called automatically if your testing framework (such as mocha, Jest or
236
236
> Jasmine) injects a global ` afterEach() ` function into the testing environment.
237
+ > If not, you will need to call ` cleanup() ` after each test.
237
238
238
239
Failing to call ` cleanup ` when you've called ` render ` could result in a memory
239
240
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