Skip to content

Commit 932f938

Browse files
committed
guard in tests against accidental IS_REACT_ACT_ENVIRONMENT
1 parent c064440 commit 932f938

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/setup-env.js

+14
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
11
import './polyfill.js'
2+
3+
Object.defineProperty(global, 'IS_REACT_ACT_ENVIRONMENT', {
4+
get() {
5+
return false
6+
},
7+
set(value) {
8+
if (!!value) {
9+
throw new Error(
10+
'Cannot set IS_REACT_ACT_ENVIRONMENT to true, this probably pulled in some RTL dependency?',
11+
)
12+
}
13+
},
14+
configurable: true,
15+
})

0 commit comments

Comments
 (0)