File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { cleanup } from './pure'
2
2
3
3
// if we're running in a test runner that supports afterEach
4
- // then we'll automatically run cleanup afterEach test
4
+ // or teardown then we'll automatically run cleanup afterEach test
5
5
// this ensures that tests run in isolation from each other
6
6
// if you don't like this then either import the `pure` module
7
7
// or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'.
8
- if ( typeof afterEach === 'function' && ! process . env . RTL_SKIP_AUTO_CLEANUP ) {
9
- afterEach ( async ( ) => {
10
- await cleanup ( )
11
- } )
8
+ if ( ! process . env . RTL_SKIP_AUTO_CLEANUP ) {
9
+ if ( typeof afterEach === 'function' ) {
10
+ afterEach ( async ( ) => {
11
+ await cleanup ( )
12
+ } )
13
+ } else if ( typeof teardown === 'function' ) {
14
+ teardown ( async ( ) => {
15
+ await cleanup ( )
16
+ } )
17
+ }
12
18
}
13
19
14
20
export * from './pure'
You can’t perform that action at this time.
0 commit comments