Skip to content

Commit a3ac774

Browse files
test:update test-debugger-random-port-with-inspect-port.js to use await/async
1 parent 7a3bd28 commit a3ac774

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

test/sequential/test-debugger-random-port-with-inspect-port.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010

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

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

17-
cli.waitForInitialBreak()
18-
.then(() => cli.waitForPrompt())
19-
.then(() => {
20-
assert.match(cli.output, /debug>/, 'prints a prompt');
21-
assert.match(
22-
cli.output,
23-
/< Debugger listening on /,
24-
'forwards child output');
25-
})
26-
.then(() => cli.quit())
27-
.then((code) => {
28-
assert.strictEqual(code, 0);
29-
});
30-
}
16+
(async () => {
17+
try {
18+
await cli.waitForInitialBreak()
19+
await cli.waitForPrompt()
20+
assert.match(cli.output, /debug>/, 'prints a prompt');
21+
assert.match(
22+
cli.output,
23+
/< Debugger listening on /,
24+
'forwards child output');
25+
} finally {
26+
const code = cli.quit()
27+
assert.strictEqual(code,0);
28+
}
29+
})();

0 commit comments

Comments
 (0)