Skip to content

Commit 66cfb82

Browse files
committed
Add check for Error.isError
1 parent 74512bb commit 66cfb82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/act-compat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ function withGlobalActEnvironment(actImplementation) {
7575
// https://github.com/testing-library/react-testing-library/issues/1392
7676
// https://github.com/testing-library/react-testing-library/issues/1399
7777
if (
78+
// Error.isError is pretty new addition to Node.js - may not be available in LTS versions
79+
Error.isError &&
7880
Error.isError(error) &&
7981
error.toString() === 'TypeError: React.act is not a function' &&
8082
process &&

0 commit comments

Comments
 (0)