Skip to content

Commit dca0815

Browse files
committed
test: introduce common.crashOnUnhandledRejection
Ref: #12442 PR-URL: #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 2055fd3 commit dca0815

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
@@ -677,3 +677,9 @@ exports.getArrayBufferViews = function getArrayBufferViews(buf) {
677677
}
678678
return out;
679679
};
680+
681+
// Crash the process on unhandled rejections.
682+
exports.crashOnUnhandledRejection = function() {
683+
process.on('unhandledRejection',
684+
(err) => process.nextTick(() => { throw err; }));
685+
};

0 commit comments

Comments
 (0)