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 d2f3616

Browse filesBrowse files
Monu-Chaudharydanielleadams
authored andcommitted
test: use async/await in test-debugger-random-port-with-inspect-port
PR-URL: #44695 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent ddf0297 commit d2f3616
Copy full SHA for d2f3616

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+13
-18
lines changed
Open diff view settings
Collapse file
+13-18Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const common = require('../common');
3-
43
common.skipIfInspectorDisabled();
54

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

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

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

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-
}
15+
(async () => {
16+
await cli.waitForInitialBreak();
17+
await cli.waitForPrompt();
18+
assert.match(cli.output, /debug>/, 'prints a prompt');
19+
assert.match(
20+
cli.output,
21+
/< Debugger listening on /,
22+
'forwards child output');
23+
const code = await cli.quit();
24+
assert.strictEqual(code, 0);
25+
})().then(common.mustCall());

0 commit comments

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