There was an error while loading. Please reload this page.
common.crashOnUnhandledRejection
1 parent ae20511 commit 4848862Copy full SHA for 4848862
test/common.js
@@ -552,3 +552,9 @@ exports.expectWarning = function(name, expected) {
552
expected.splice(expected.indexOf(warning.message), 1);
553
}, expected.length));
554
};
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