summaryrefslogtreecommitdiff
path: root/test/parallel/test-debugger-exec-scope.mjs
blob: 3e4241cd018fc46b93303a9ef45b3d4e67b8a202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { skipIfInspectorDisabled } from '../common/index.mjs';

skipIfInspectorDisabled();

import { path } from '../common/fixtures.mjs';
import startCLI from '../common/debugger.js';

import assert from 'assert';

const cli = startCLI(['--port=0', path('debugger/backtrace.js')]);

try {
  await cli.waitForInitialBreak();
  await cli.waitForPrompt();
  await cli.stepCommand('c');
  await cli.command('exec .scope');
  assert.match(cli.output, /'moduleScoped'/, 'displays closure from module body');
  assert.match(cli.output, /'a'/, 'displays local / function arg');
  assert.match(cli.output, /'l1'/, 'displays local scope');
  assert.doesNotMatch(cli.output, /'encodeURIComponent'/, 'omits global scope');
} finally {
  await cli.quit();
}