• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flags: --unhandled-rejections=strict
2'use strict';
3
4require('../../common');
5
6// Check that the process will exit on the first unhandled rejection in case the
7// unhandled rejections mode is set to `'strict'`.
8
9const ref1 = new Promise(() => {
10  throw new Error('One');
11});
12
13const ref2 = Promise.reject(new Error('Two'));
14
15// Keep the event loop alive to actually detect the unhandled rejection.
16setTimeout(() => console.log(ref1, ref2), 1000);
17