summaryrefslogtreecommitdiff
path: root/test/parallel/test-promise-unhandled-flag.js
blob: 40a903091767337d3c00950d94c3b5c148acefd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';

require('../common');
const assert = require('assert');
const cp = require('child_process');

// Verify that a faulty environment variable throws on bootstrapping.
// Therefore we do not need any special handling for the child process.
const child = cp.spawnSync(
  process.execPath,
  ['--unhandled-rejections=foobar', __filename]
);

assert.strictEqual(child.stdout.toString(), '');
assert(child.stderr.includes(
  'invalid value for --unhandled-rejections'), child.stderr);