Skip to content

Commit af2aa5b

Browse files
pshastricbjuanarbol
authored andcommitted
test: modify test-debugger-custom-port.js to use async-await
PR-URL: #44680 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent e10095a commit af2aa5b

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

‎test/sequential/test-debugger-custom-port.js‎

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

1111
// Custom port.
12-
{
13-
constscript=fixtures.path('debugger','three-lines.js');
12+
constscript=fixtures.path('debugger','three-lines.js');
1413

15-
constcli=startCLI([`--port=${common.PORT}`,script]);
16-
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-
newRegExp(`< Debugger listening on [^\n]*${common.PORT}`),
24-
'forwards child output');
25-
})
26-
.then(()=>cli.quit())
27-
.then((code)=>{
28-
assert.strictEqual(code,0);
29-
});
30-
}
14+
constcli=startCLI([`--port=${common.PORT}`,script]);
15+
(asyncfunction(){
16+
try{
17+
awaitcli.waitForInitialBreak();
18+
awaitcli.waitForPrompt();
19+
assert.match(cli.output,/debug>/,'prints a prompt');
20+
assert.match(
21+
cli.output,
22+
newRegExp(`< Debugger listening on [^\n]*${common.PORT}`),
23+
'forwards child output');
24+
}finally{
25+
constcode=awaitcli.quit();
26+
assert.strictEqual(code,0);
27+
}
28+
})().then(common.mustCall());

0 commit comments

Comments
(0)