Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test:update test-debugger-random-port-with-inspect-port.js to use awa… #44695

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 13 additions & 18 deletions test/sequential/test-debugger-random-port-with-inspect-port.js
@@ -1,6 +1,5 @@
'use strict';
const common = require('../common');

common.skipIfInspectorDisabled();

const fixtures = require('../common/fixtures');
Expand All @@ -9,22 +8,18 @@ const startCLI = require('../common/debugger');
const assert = require('assert');

// Random port with --inspect-port=0.
{
const script = fixtures.path('debugger', 'three-lines.js');
const script = fixtures.path('debugger', 'three-lines.js');

const cli = startCLI(['--inspect-port=0', script]);
const cli = startCLI(['--inspect-port=0', script]);

cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => {
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
cli.output,
/< Debugger listening on /,
'forwards child output');
})
.then(() => cli.quit())
.then((code) => {
assert.strictEqual(code, 0);
});
}
(async () => {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
cli.output,
/< Debugger listening on /,
'forwards child output');
const code = await cli.quit();
assert.strictEqual(code, 0);
})().then(common.mustCall());