1'use strict';
2const common = require('../common');
3
4common.skipIfInspectorDisabled();
5
6const fixtures = require('../common/fixtures');
7const startCLI = require('../common/debugger');
8
9const assert = require('assert');
10
11// Custom port.
12const script = fixtures.path('debugger', 'three-lines.js');
13
14const cli = startCLI([`--port=${common.PORT}`, script]);
15(async function() {
16  try {
17    await cli.waitForInitialBreak();
18    await cli.waitForPrompt();
19    assert.match(cli.output, /debug>/, 'prints a prompt');
20    assert.match(
21      cli.output,
22      new RegExp(`< Debugger listening on [^\n]*${common.PORT}`),
23      'forwards child output');
24  } finally {
25    const code = await cli.quit();
26    assert.strictEqual(code, 0);
27  }
28})().then(common.mustCall());
29