• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3const fixtures = require('../common/fixtures');
4
5common.skipIfInspectorDisabled();
6
7const assert = require('assert');
8const execFile = require('child_process').execFile;
9
10const mainScript = fixtures.path('loop.js');
11const expected =
12  '`node --debug` and `node --debug-brk` are invalid. ' +
13  'Please use `node --inspect` and `node --inspect-brk` instead.';
14for (const invalidArg of ['--debug-brk', '--debug']) {
15  execFile(
16    process.execPath,
17    [invalidArg, mainScript],
18    common.mustCall((error, stdout, stderr) => {
19      assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`);
20      assert.strictEqual(
21        stderr.includes(expected),
22        true,
23        `${stderr} should include '${expected}'`
24      );
25    })
26  );
27}
28