Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change promises to async/await in test-debugger-invalid-args.js #44678

Merged
merged 1 commit into from Sep 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 13 additions & 17 deletions test/sequential/test-debugger-invalid-args.js
Expand Up @@ -8,24 +8,20 @@ const startCLI = require('../common/debugger');
const assert = require('assert');

// Launch CLI w/o args.
{
(async () => {
const cli = startCLI([]);
cli.quit()
.then((code) => {
assert.strictEqual(code, 1);
assert.match(cli.output, /^Usage:/, 'Prints usage info');
});
}
const code = await cli.quit();
assert.strictEqual(code, 1);
assert.match(cli.output, /^Usage:/, 'Prints usage info');
})().then(common.mustCall());

// Launch w/ invalid host:port.
{
(async () => {
const cli = startCLI([`localhost:${common.PORT}`]);
cli.quit()
.then((code) => {
assert.match(
cli.output,
/failed to connect/,
'Tells the user that the connection failed');
assert.strictEqual(code, 1);
});
}
const code = await cli.quit();
assert.match(
cli.output,
/failed to connect/,
'Tells the user that the connection failed');
assert.strictEqual(code, 1);
})().then(common.mustCall());