xref: /third_party/node/test/parallel/test-debugger-random-port-with-inspect-port.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
61cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst assert = require('assert');
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci// Random port with --inspect-port=0.
111cb0ef41Sopenharmony_ciconst script = fixtures.path('debugger', 'three-lines.js');
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ciconst cli = startCLI(['--inspect-port=0', script]);
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci(async () => {
161cb0ef41Sopenharmony_ci  await cli.waitForInitialBreak();
171cb0ef41Sopenharmony_ci  await cli.waitForPrompt();
181cb0ef41Sopenharmony_ci  assert.match(cli.output, /debug>/, 'prints a prompt');
191cb0ef41Sopenharmony_ci  assert.match(
201cb0ef41Sopenharmony_ci    cli.output,
211cb0ef41Sopenharmony_ci    /< Debugger listening on /,
221cb0ef41Sopenharmony_ci    'forwards child output');
231cb0ef41Sopenharmony_ci  const code = await cli.quit();
241cb0ef41Sopenharmony_ci  assert.strictEqual(code, 0);
251cb0ef41Sopenharmony_ci})().then(common.mustCall());
26

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