Browse Source

test: introduce `common.crashOnUnhandledRejection`

Ref: https://github.com/nodejs/node/pull/12442
PR-URL: https://github.com/nodejs/node/pull/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>
v6
Anna Henningsen 8 years ago
parent
commit
dca08152cb
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 6
      test/common.js

6
test/common.js

@ -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; }));
};

Loading…
Cancel
Save