xref: /third_party/node/test/parallel/test-debugger-random-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_ci
41cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
71cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst assert = require('assert');
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci// Random port.
121cb0ef41Sopenharmony_ci{
131cb0ef41Sopenharmony_ci  const script = fixtures.path('debugger', 'three-lines.js');
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci  const cli = startCLI(['--port=0', script]);
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ci  cli.waitForInitialBreak()
181cb0ef41Sopenharmony_ci    .then(() => cli.waitForPrompt())
191cb0ef41Sopenharmony_ci    .then(() => {
201cb0ef41Sopenharmony_ci      assert.match(cli.output, /debug>/, 'prints a prompt');
211cb0ef41Sopenharmony_ci      assert.match(
221cb0ef41Sopenharmony_ci        cli.output,
231cb0ef41Sopenharmony_ci        /< Debugger listening on /,
241cb0ef41Sopenharmony_ci        'forwards child output');
251cb0ef41Sopenharmony_ci    })
261cb0ef41Sopenharmony_ci    .then(() => cli.quit())
271cb0ef41Sopenharmony_ci    .then((code) => {
281cb0ef41Sopenharmony_ci      assert.strictEqual(code, 0);
291cb0ef41Sopenharmony_ci    });
301cb0ef41Sopenharmony_ci}
31

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