summaryrefslogtreecommitdiff
path: root/deps/node-inspect/test/cli/help.test.js
blob: 9f0c081bdee39a59eb9ba7261cfa08166ac9fdee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
const { test } = require('tap');

const startCLI = require('./start-cli');

test('examples/empty.js', (t) => {
  const cli = startCLI(['examples/empty.js']);

  function onFatal(error) {
    cli.quit();
    throw error;
  }

  return cli.waitForInitialBreak()
    .then(() => cli.waitForPrompt())
    .then(() => cli.command('help'))
    .then(() => {
      t.match(cli.output, /run, restart, r\s+/m);
    })
    .then(() => cli.quit())
    .then(null, onFatal);
});