node/test/sequential/test-debugger-invalid-args.js
Rich Trott 6463adf183 test: move debugger test case to parallel
Move test case that does not require a predetermined port to parallel.

PR-URL: https://github.com/nodejs/node/pull/39300
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2021-07-09 17:04:07 -07:00

32 lines
661 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const startCLI = require('../common/debugger');
const assert = require('assert');
// Launch CLI w/o args.
{
const cli = startCLI([]);
cli.quit()
.then((code) => {
assert.strictEqual(code, 1);
assert.match(cli.output, /^Usage:/, 'Prints usage info');
});
}
// Launch w/ invalid host:port.
{
const cli = startCLI([`localhost:${common.PORT}`]);
cli.quit()
.then((code) => {
assert.match(
cli.output,
/failed to connect/,
'Tells the user that the connection failed');
assert.strictEqual(code, 1);
});
}