node/test/sequential/test-debugger-invalid-args.js
Debadree Chatterjee 5b5898ac86
lib,src: update exit codes as per todos
Refs: https://github.com/nodejs/node/pull/44746
PR-URL: https://github.com/nodejs/node/pull/45841
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-26 17:03:06 +00:00

28 lines
695 B
JavaScript

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