node/test/parallel/test-inspector-invalid-args.js
Sam Roberts aae0d4559c test: rearrange inspector headers into convention
Test guide describes a conventional layout for test headers, review
inspector tests and reorganize to follow the convention.

PR-URL: https://github.com/nodejs/node/pull/13428
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-05 12:28:37 -07:00

25 lines
793 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const assert = require('assert');
const execFile = require('child_process').execFile;
const path = require('path');
const mainScript = path.join(common.fixturesDir, 'loop.js');
const expected =
'`node --debug` and `node --debug-brk` are invalid. ' +
'Please use `node --inspect` or `node --inspect-brk` instead.';
for (const invalidArg of ['--debug-brk', '--debug']) {
execFile(
process.execPath,
[ invalidArg, mainScript ],
common.mustCall((error, stdout, stderr) => {
assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`);
assert.strictEqual(stderr.includes(expected), true,
`${stderr} should include '${expected}'`);
})
);
}