xref: /third_party/node/test/sequential/test-debugger-invalid-args.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/sequential/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst assert = require('assert');
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci// Launch CLI w/o args.
111cb0ef41Sopenharmony_ci(async () => {
121cb0ef41Sopenharmony_ci  const cli = startCLI([]);
131cb0ef41Sopenharmony_ci  const code = await cli.quit();
141cb0ef41Sopenharmony_ci  assert.strictEqual(code, 1);
151cb0ef41Sopenharmony_ci  assert.match(cli.output, /^Usage:/, 'Prints usage info');
161cb0ef41Sopenharmony_ci})().then(common.mustCall());
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci// Launch w/ invalid host:port.
191cb0ef41Sopenharmony_ci(async () => {
201cb0ef41Sopenharmony_ci  const cli = startCLI([`localhost:${common.PORT}`]);
211cb0ef41Sopenharmony_ci  const code = await cli.quit();
221cb0ef41Sopenharmony_ci  assert.match(
231cb0ef41Sopenharmony_ci    cli.output,
241cb0ef41Sopenharmony_ci    /failed to connect/,
251cb0ef41Sopenharmony_ci    'Tells the user that the connection failed');
261cb0ef41Sopenharmony_ci  assert.strictEqual(code, 1);
271cb0ef41Sopenharmony_ci})().then(common.mustCall());
28

Indexes created Thu Nov 07 10:32:03 CST 2024