node/test/sequential/test-debugger-custom-port.js
Rich Trott 9cdac42f3d test: replace "inspector-cli" with "debugger"
When I moved node-inspect into core, I called a lot of things
`inspector-cli` that really should have been `debugger`. This is the
last of them to be renamed.

PR-URL: https://github.com/nodejs/node/pull/39156
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-28 06:26:02 -07:00

31 lines
748 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
const assert = require('assert');
// Custom port.
{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([`--port=${common.PORT}`, script]);
cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => {
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
cli.output,
new RegExp(`< Debugger listening on [^\n]*${common.PORT}`),
'forwards child output');
})
.then(() => cli.quit())
.then((code) => {
assert.strictEqual(code, 0);
});
}