Skip to content

Commit 0a3b59b

Browse files
addaleaxgibfahn
authored andcommittedJun 20, 2017
test: introduce common.crashOnUnhandledRejection
Ref: #12442 PR-URL: #12489 Backport-PR-URL: #13103 Reviewed-By: Matthew Loring <[email protected]> Reviewed-By: Julien Gilli <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 2783d2d commit 0a3b59b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎test/common.js

+6
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,9 @@ exports.expectWarning = function(name, expected) {
552552
expected.splice(expected.indexOf(warning.message), 1);
553553
}, expected.length));
554554
};
555+
556+
// Crash the process on unhandled rejections.
557+
exports.crashOnUnhandledRejection = function() {
558+
process.on('unhandledRejection',
559+
(err) => process.nextTick(() => { throw err; }));
560+
};

0 commit comments

Comments
 (0)
Please sign in to comment.