Permalink
Browse files

test: introduce `common.crashOnUnhandledRejection`

Ref: #12442
PR-URL: #12489
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Julien Gilli <jgilli@nodejs.org>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
addaleax committed Apr 19, 2017
1 parent 2055fd3 commit dca08152cbb6024376fe6280d5fdc956682a4046
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/common.js
View
@@ -677,3 +677,9 @@ exports.getArrayBufferViews = function getArrayBufferViews(buf) {
}
return out;
};
// Crash the process on unhandled rejections.
exports.crashOnUnhandledRejection = function() {
process.on('unhandledRejection',
(err) => process.nextTick(() => { throw err; }));
};

0 comments on commit dca0815

Please sign in to comment.