Skip to content

Commit cb5c93a

Browse files
committed
test: introduce common.crashOnUnhandledRejection
Ref: nodejs#12442 PR-URL: nodejs#12489 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 b09f738 commit cb5c93a

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)