• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flags: --unhandled-rejections=none
2'use strict';
3
4const common = require('../common');
5const assert = require('assert');
6
7// Verify that ignoring unhandled rejection works fine and that no warning is
8// logged even though there is no unhandledRejection hook attached.
9
10new Promise(() => {
11  throw new Error('One');
12});
13
14Promise.reject('test');
15
16process.on('warning', common.mustNotCall('warning'));
17process.on('uncaughtException', common.mustNotCall('uncaughtException'));
18process.on('exit', assert.strictEqual.bind(null, 0));
19
20setTimeout(common.mustCall(), 2);
21