We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8c6b4d commit bf13638Copy full SHA for bf13638
src/index.js
@@ -22,4 +22,15 @@ if (typeof process === 'undefined' || !process.env?.RTL_SKIP_AUTO_CLEANUP) {
22
}
23
24
25
+// This matches the behavior of React < 18.
26
+if (typeof beforeAll === 'function' && typeof afterAll === 'function') {
27
+ beforeAll(() => {
28
+ global.IS_REACT_ACT_ENVIRONMENT = true
29
+ })
30
+
31
+ afterAll(() => {
32
+ global.IS_REACT_ACT_ENVIRONMENT = false
33
34
+}
35
36
export * from './pure'
tests/setup-env.js
@@ -1,9 +1 @@
1
import '@testing-library/jest-dom/extend-expect'
2
-
3
-beforeEach(() => {
4
- global.IS_REACT_ACT_ENVIRONMENT = true
5
-})
6
7
-afterEach(() => {
8
- global.IS_REACT_ACT_ENVIRONMENT = false
9
0 commit comments