mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: update startCLI to set --port=0 by default
update the `startCLI` debugging testing utility to set by default the port to use to `0` (i.e. a random port) PR-URL: https://github.com/nodejs/node/pull/59042 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ const assert = require('assert');
|
||||
// Custom port.
|
||||
const script = fixtures.path('debugger', 'three-lines.js');
|
||||
|
||||
const cli = startCLI([`--port=${common.PORT}`, script]);
|
||||
const cli = startCLI([`--port=${common.PORT}`, script], [], {}, { randomPort: false });
|
||||
(async function() {
|
||||
try {
|
||||
await cli.waitForInitialBreak();
|
||||
|
||||
@@ -9,7 +9,7 @@ const assert = require('assert');
|
||||
|
||||
// Launch CLI w/o args.
|
||||
(async () => {
|
||||
const cli = startCLI([]);
|
||||
const cli = startCLI([], [], {}, { randomPort: false });
|
||||
const code = await cli.quit();
|
||||
assert.strictEqual(code, 9);
|
||||
assert.match(cli.output, /^Usage:/, 'Prints usage info');
|
||||
@@ -17,7 +17,7 @@ const assert = require('assert');
|
||||
|
||||
// Launch w/ invalid host:port.
|
||||
(async () => {
|
||||
const cli = startCLI([`localhost:${common.PORT}`]);
|
||||
const cli = startCLI([`localhost:${common.PORT}`], [], {}, { randomPort: false });
|
||||
const code = await cli.quit();
|
||||
assert.match(
|
||||
cli.output,
|
||||
|
||||
@@ -8,7 +8,7 @@ import startCLI from '../common/debugger.js';
|
||||
import assert from 'assert';
|
||||
|
||||
const script = path('debugger', 'three-lines.js');
|
||||
const cli = startCLI([script]);
|
||||
const cli = startCLI([script], [], {}, { randomPort: false });
|
||||
try {
|
||||
await cli.waitForInitialBreak();
|
||||
await cli.waitForPrompt();
|
||||
|
||||
@@ -13,7 +13,7 @@ const script = fixtures.path('debugger', 'alive.js');
|
||||
|
||||
const runTest = async () => {
|
||||
const target = spawn(process.execPath, [script]);
|
||||
const cli = startCLI(['-p', `${target.pid}`]);
|
||||
const cli = startCLI(['-p', `${target.pid}`], [], {}, { randomPort: false });
|
||||
|
||||
try {
|
||||
await cli.waitForPrompt();
|
||||
|
||||
Reference in New Issue
Block a user