Browse Source

test: introduce `common.crashOnUnhandledRejection`

Ref: https://github.com/nodejs/node/pull/12442
PR-URL: https://github.com/nodejs/node/pull/12489
Backport-PR-URL: https://github.com/nodejs/node/pull/13103
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.x
Anna Henningsen 8 years ago
committed by Myles Borins
parent
commit
4eb28c80e8
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 6
      test/common.js

6
test/common.js

@ -552,3 +552,9 @@ exports.expectWarning = function(name, expected) {
expected.splice(expected.indexOf(warning.message), 1);
}, expected.length));
};
// Crash the process on unhandled rejections.
exports.crashOnUnhandledRejection = function() {
process.on('unhandledRejection',
(err) => process.nextTick(() => { throw err; }));
};

Loading…
Cancel
Save