• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// List scripts.
12{
13  const script = fixtures.path('debugger', 'three-lines.js');
14  const cli = startCLI(['--port=0', script]);
15
16  (async () => {
17    try {
18      await cli.waitForInitialBreak();
19      await cli.waitForPrompt();
20      await cli.command('scripts');
21      assert.match(
22        cli.output,
23        /^\* \d+: \S+debugger(?:\/|\\)three-lines\.js/m,
24        'lists the user script');
25      assert.doesNotMatch(
26        cli.output,
27        /\d+: node:internal\/buffer/,
28        'omits node-internal scripts');
29      await cli.command('scripts(true)');
30      assert.match(
31        cli.output,
32        /\* \d+: \S+debugger(?:\/|\\)three-lines\.js/,
33        'lists the user script');
34      assert.match(
35        cli.output,
36        /\d+: node:internal\/buffer/,
37        'includes node-internal scripts');
38    } finally {
39      await cli.quit();
40    }
41  })().then(common.mustCall());
42}
43