Skip to content

Commit 27ab3b2

Browse files
authored
(#8686) - tests: safely de-reference PromiseRejectionEvent
Co-authored-by: alxndrsn <alxndrsn>
1 parent e8680dd commit 27ab3b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/integration/test.setup_global_hooks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ beforeEach(function (done) {
1515
afterEach(function (done) {
1616
testUtils.removeUnhandledRejectionListener(currentListener);
1717
if (currentError) {
18-
if (currentError instanceof PromiseRejectionEvent) {
18+
if (typeof PromiseRejectionEvent !== 'undefined' &&
19+
currentError instanceof PromiseRejectionEvent) {
1920
currentError = currentError.reason;
2021
}
2122

0 commit comments

Comments
 (0)