test: use async/await in test-debugger-help

PR-URL: https://github.com/nodejs/node/pull/44686
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Chandana
2022-09-29 16:29:11 -07:00
committed by GitHub
parent 29c35ea823
commit e236af8d54
2 changed files with 19 additions and 27 deletions

View File

@@ -1,27 +0,0 @@
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
const assert = require('assert');
{
const cli = startCLI([fixtures.path('debugger/empty.js')]);
function onFatal(error) {
cli.quit();
throw error;
}
return cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.command('help'))
.then(() => {
assert.match(cli.output, /run, restart, r\s+/m);
})
.then(() => cli.quit())
.then(null, onFatal);
}

View File

@@ -0,0 +1,19 @@
import { skipIfInspectorDisabled } from '../common/index.mjs';
skipIfInspectorDisabled();
import { path } from '../common/fixtures.mjs';
import startCLI from '../common/debugger.js';
import assert from 'assert';
const cli = startCLI([path('debugger', 'empty.js')]);
try {
await cli.waitForInitialBreak();
await cli.waitForPrompt();
await cli.command('help');
assert.match(cli.output, /run, restart, r\s+/m);
} finally {
cli.quit();
}