mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Currently, we say "listening" when we are ending the server. Change it to "ending". Fixes: https://github.com/nodejs/node/issues/39272 PR-URL: https://github.com/nodejs/node/pull/39334 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yash Ladha <yash@yashladha.in>
40 lines
947 B
JavaScript
40 lines
947 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const assert = require('assert');
|
|
|
|
const RESTARTS = 10;
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
const startCLI = require('../common/debugger');
|
|
|
|
// Using `restart` should result in only one "Connect/For help" message.
|
|
{
|
|
const script = fixtures.path('debugger', 'three-lines.js');
|
|
const cli = startCLI([script]);
|
|
|
|
function onFatal(error) {
|
|
cli.quit();
|
|
throw error;
|
|
}
|
|
|
|
const listeningRegExp = /Debugger listening on/g;
|
|
|
|
cli.waitForInitialBreak()
|
|
.then(() => cli.waitForPrompt())
|
|
.then(() => {
|
|
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
|
|
})
|
|
.then(async () => {
|
|
for (let i = 0; i < RESTARTS; i++) {
|
|
await cli.stepCommand('restart');
|
|
assert.strictEqual(cli.output.match(listeningRegExp).length, 1);
|
|
}
|
|
})
|
|
.then(() => cli.quit())
|
|
.then(null, onFatal);
|
|
}
|