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