1// Flags: --unhandled-rejections=none 2'use strict'; 3 4const common = require('../common'); 5 6common.disableCrashOnUnhandledRejection(); 7 8// Verify that ignoring unhandled rejection works fine and that no warning is 9// logged. 10 11new Promise(() => { 12 throw new Error('One'); 13}); 14 15Promise.reject('test'); 16 17process.on('warning', common.mustNotCall('warning')); 18process.on('uncaughtException', common.mustNotCall('uncaughtException')); 19process.on('rejectionHandled', common.mustNotCall('rejectionHandled')); 20 21process.on('unhandledRejection', common.mustCall(2)); 22 23setTimeout(common.mustCall(), 2); 24