mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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);
|
||||
}
|
||||
19
test/sequential/test-debugger-help.mjs
Normal file
19
test/sequential/test-debugger-help.mjs
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user