xref: /third_party/node/test/sequential/test-debugger-custom-port.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 fixtures = require('../common/fixtures');
71cb0ef41Sopenharmony_ciconst startCLI = require('../common/debugger');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst assert = require('assert');
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci// Custom port.
121cb0ef41Sopenharmony_ciconst script = fixtures.path('debugger', 'three-lines.js');
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciconst cli = startCLI([`--port=${common.PORT}`, script]);
151cb0ef41Sopenharmony_ci(async function() {
161cb0ef41Sopenharmony_ci  try {
171cb0ef41Sopenharmony_ci    await cli.waitForInitialBreak();
181cb0ef41Sopenharmony_ci    await cli.waitForPrompt();
191cb0ef41Sopenharmony_ci    assert.match(cli.output, /debug>/, 'prints a prompt');
201cb0ef41Sopenharmony_ci    assert.match(
211cb0ef41Sopenharmony_ci      cli.output,
221cb0ef41Sopenharmony_ci      new RegExp(`< Debugger listening on [^\n]*${common.PORT}`),
231cb0ef41Sopenharmony_ci      'forwards child output');
241cb0ef41Sopenharmony_ci  } finally {
251cb0ef41Sopenharmony_ci    const code = await cli.quit();
261cb0ef41Sopenharmony_ci    assert.strictEqual(code, 0);
271cb0ef41Sopenharmony_ci  }
281cb0ef41Sopenharmony_ci})().then(common.mustCall());
29

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