Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9864bde

Browse filesBrowse files
pshastricbdanielleadams
authored andcommitted
test: modify test-debugger-custom-port.js to use async-await
PR-URL: #44680 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent f92871a commit 9864bde
Copy full SHA for 9864bde

File tree

Expand file treeCollapse file tree

1 file changed

+16
-18
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-18
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/sequential/test-debugger-custom-port.js
+16-18Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,20 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.