1// Flags: --unhandled-rejections=warn 2'use strict'; 3 4const common = require('../common'); 5 6// Verify that --unhandled-rejections=warn works fine 7 8new Promise(() => { 9 throw new Error('One'); 10}); 11 12Promise.reject('test'); 13 14// Unhandled rejections trigger two warning per rejection. One is the rejection 15// reason and the other is a note where this warning is coming from. 16process.on('warning', common.mustCall(4)); 17process.on('uncaughtException', common.mustNotCall('uncaughtException')); 18process.on('rejectionHandled', common.mustNotCall('rejectionHandled')); 19 20setTimeout(common.mustCall(), 2); 21