GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: update `startCLI` to set `--port=0` by default · nodejs/node@a23562f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • common
      • debugger.js
    • parallel
      • test-debugger-address.mjs
      • test-debugger-auto-resume.mjs
      • test-debugger-backtrace.js
      • test-debugger-break.js
      • test-debugger-breakpoint-exists.js
      • test-debugger-clear-breakpoints.js
      • test-debugger-exceptions.js
      • test-debugger-exec-scope.mjs
      • test-debugger-exec.js
      • test-debugger-extract-function-name.mjs
      • test-debugger-heap-profiler.js
      • test-debugger-help.mjs
      • test-debugger-invalid-json.mjs
      • test-debugger-list.js
      • test-debugger-low-level.js
      • test-debugger-object-type-remote-object.js
      • test-debugger-preserve-breaks.js
      • test-debugger-profile-command.js
      • test-debugger-profile.js
      • test-debugger-random-port-with-inspect-port.js
      • test-debugger-random-port.js
      • test-debugger-restart-message.js
      • test-debugger-run-after-quit-restart.js
      • test-debugger-sb-before-load.js
      • test-debugger-scripts.js
      • test-debugger-set-context-line-number.mjs
      • test-debugger-unavailable-port.js
      • test-debugger-use-strict.js
      • test-debugger-watch-validation.js
      • test-debugger-watchers.mjs
    • sequential
      • test-debugger-custom-port.js
      • test-debugger-invalid-args.js
      • test-debugger-launch.mjs
      • test-debugger-pid.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/debugger.js‎

Copy file name to clipboardExpand all lines: test/common/debugger.js
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ function isPreBreak(output) {
2020
return /Break on start/.test(output) && /1 \(function \(exports/.test(output);
2121
}
2222

23-
function startCLI(args, flags = [], spawnOpts = {}) {
23+
function startCLI(args, flags = [], spawnOpts = {}, opts = { randomPort: true }) {
2424
let stderrOutput = '';
25-
const child =
26-
spawn(process.execPath, [...flags, 'inspect', ...args], spawnOpts);
25+
const child = spawn(process.execPath, [
26+
...flags,
27+
'inspect',
28+
...(opts.randomPort !== false ? ['--port=0'] : []),
29+
...args,
30+
], spawnOpts);
2731

2832
const outputBuffer = [];
2933
function bufferOutput(chunk) {
Collapse file

‎test/parallel/test-debugger-address.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-address.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function launchTarget(...args) {
5555
try {
5656
const { childProc, host, port } = await launchTarget('--inspect=0', script);
5757
target = childProc;
58-
cli = startCLI([`${host || '127.0.0.1'}:${port}`]);
58+
cli = startCLI([`${host || '127.0.0.1'}:${port}`], [], {}, { randomPort: false });
5959
await cli.waitForPrompt();
6060
await cli.command('sb("alive.js", 3)');
6161
await cli.waitFor(/break/);
Collapse file

‎test/parallel/test-debugger-auto-resume.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-auto-resume.mjs
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ addLibraryPath(process.env);
2121
};
2222
env.NODE_INSPECT_RESUME_ON_START = '1';
2323

24-
const cli = startCLI(['--port=0', script], [], {
25-
env,
26-
});
24+
const cli = startCLI([script], [], { env });
2725

2826
await cli.waitForInitialBreak();
2927
deepStrictEqual(cli.breakInfo, {
Collapse file

‎test/parallel/test-debugger-backtrace.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-backtrace.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'backtrace.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI(['--port=0', script]);
16+
const cli = startCLI([script]);
1717

1818
async function runTest() {
1919
try {
Collapse file

‎test/parallel/test-debugger-break.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-break.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const path = require('path');
1111

1212
const scriptFullPath = fixtures.path('debugger', 'break.js');
1313
const script = path.relative(process.cwd(), scriptFullPath);
14-
const cli = startCLI(['--port=0', script]);
14+
const cli = startCLI([script]);
1515

1616
(async () => {
1717
await cli.waitForInitialBreak();
Collapse file

‎test/parallel/test-debugger-breakpoint-exists.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-breakpoint-exists.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const startCLI = require('../common/debugger');
99

1010
// Test for "Breakpoint at specified location already exists" error.
1111
const script = fixtures.path('debugger', 'three-lines.js');
12-
const cli = startCLI(['--port=0', script]);
12+
const cli = startCLI([script]);
1313

1414
(async () => {
1515
try {
Collapse file

‎test/parallel/test-debugger-clear-breakpoints.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-clear-breakpoints.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'break.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI(['--port=0', script]);
16+
const cli = startCLI([script]);
1717

1818
function onFatal(error) {
1919
cli.quit();
Collapse file

‎test/parallel/test-debugger-exceptions.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-exceptions.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require('path');
1313
{
1414
const scriptFullPath = fixtures.path('debugger', 'exceptions.js');
1515
const script = path.relative(process.cwd(), scriptFullPath);
16-
const cli = startCLI(['--port=0', script]);
16+
const cli = startCLI([script]);
1717

1818
(async () => {
1919
try {
Collapse file

‎test/parallel/test-debugger-exec-scope.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-exec-scope.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import startCLI from '../common/debugger.js';
77

88
import assert from 'assert';
99

10-
const cli = startCLI(['--port=0', path('debugger/backtrace.js')]);
10+
const cli = startCLI([path('debugger/backtrace.js')]);
1111

1212
try {
1313
await cli.waitForInitialBreak();
Collapse file

‎test/parallel/test-debugger-exec.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-exec.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11-
const cli = startCLI(['--port=0', fixtures.path('debugger/alive.js')]);
11+
const cli = startCLI([fixtures.path('debugger/alive.js')]);
1212

1313
async function waitInitialBreak() {
1414
try {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.