Skip to content

Commit

Permalink
test: introduce common.crashOnUnhandledRejection
Browse files Browse the repository at this point in the history
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 27, 2017
1 parent 2055fd3 commit dca0815
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.