Skip to content

Commit

Permalink
test:update test-debugger-random-port-with-inspect-port.js to use awa…
Browse files Browse the repository at this point in the history
…it/async
  • Loading branch information
Monu-Chaudhary committed Sep 16, 2022
1 parent 5d92ddc commit 5360a1a
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions test/sequential/test-debugger-random-port-with-inspect-port.js
Expand Up @@ -9,22 +9,21 @@ 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 () => {
try {
await cli.waitForInitialBreak()
await cli.waitForPrompt()
assert.match(cli.output, /debug>/, 'prints a prompt');
assert.match(
cli.output,
/< Debugger listening on /,
'forwards child output');
} finally {
const code = cli.quit()
assert.strictEqual(code,0);
}
})();

0 comments on commit 5360a1a

Please sign in to comment.