Skip to content

Commit 858631f

Browse files
nupurchauhan6RafaelGSS
authored andcommitted
test: use async/await in test-debugger-invalid-args
PR-URL: #44678 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 6c9ded8 commit 858631f

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

test/sequential/test-debugger-invalid-args.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@ const startCLI = require('../common/debugger');
88
const assert = require('assert');
99

1010
// Launch CLI w/o args.
11-
{
11+
(async () => {
1212
const cli = startCLI([]);
13-
cli.quit()
14-
.then((code) => {
15-
assert.strictEqual(code, 1);
16-
assert.match(cli.output, /^Usage:/, 'Prints usage info');
17-
});
18-
}
13+
const code = await cli.quit();
14+
assert.strictEqual(code, 1);
15+
assert.match(cli.output, /^Usage:/, 'Prints usage info');
16+
})().then(common.mustCall());
1917

2018
// Launch w/ invalid host:port.
21-
{
19+
(async () => {
2220
const cli = startCLI([`localhost:${common.PORT}`]);
23-
cli.quit()
24-
.then((code) => {
25-
assert.match(
26-
cli.output,
27-
/failed to connect/,
28-
'Tells the user that the connection failed');
29-
assert.strictEqual(code, 1);
30-
});
31-
}
21+
const code = await cli.quit();
22+
assert.match(
23+
cli.output,
24+
/failed to connect/,
25+
'Tells the user that the connection failed');
26+
assert.strictEqual(code, 1);
27+
})().then(common.mustCall());

0 commit comments

Comments
 (0)