0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-promise-handled-rejection-no-warning.js
cjihrig 7cf6f9e964
process: refactor unhandledRejection logic
This commit prevents a deprecation warning from being emitted
if the unhandledRejection event was actually handled.

PR-URL: https://github.com/nodejs/node/pull/28540
Fixes: https://github.com/nodejs/node/issues/28539
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-07-07 11:29:31 -04:00

9 lines
301 B
JavaScript

'use strict';
const common = require('../common');
// This test verifies that DEP0018 does not occur when rejections are handled.
common.disableCrashOnUnhandledRejection();
process.on('warning', common.mustNotCall());
process.on('unhandledRejection', common.mustCall());
Promise.reject(new Error());