2021-04-09 06:55:45 +00:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
|
|
|
|
const fixtures = require('../common/fixtures');
|
2021-05-04 04:58:42 +00:00
|
|
|
const startCLI = require('../common/debugger');
|
2021-04-09 06:55:45 +00:00
|
|
|
|
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
// Random port.
|
|
|
|
{
|
2021-06-26 05:11:59 +00:00
|
|
|
const script = fixtures.path('debugger', 'three-lines.js');
|
2021-04-09 06:55:45 +00:00
|
|
|
|
|
|
|
const cli = startCLI(['--port=0', script]);
|
|
|
|
|
|
|
|
cli.waitForInitialBreak()
|
|
|
|
.then(() => cli.waitForPrompt())
|
|
|
|
.then(() => {
|
|
|
|
assert.match(cli.output, /debug>/, 'prints a prompt');
|
|
|
|
assert.match(
|
|
|
|
cli.output,
|
|
|
|
/< Debugger listening on /,
|
|
|
|
'forwards child output');
|
|
|
|
})
|
|
|
|
.then(() => cli.quit())
|
|
|
|
.then((code) => {
|
|
|
|
assert.strictEqual(code, 0);
|
|
|
|
});
|
|
|
|
}
|