mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
test: use async/await in test-debugger-invalid-args
PR-URL: https://github.com/nodejs/node/pull/44678 Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
6c9ded810c
commit
858631f720
1 file changed
+13
-17
@@ -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());
|
||||
Reference in new issue
Block a user