• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import { skipIfInspectorDisabled } from '../common/index.mjs';
2
3skipIfInspectorDisabled();
4
5import { path as _path } from '../common/fixtures.js';
6import startCLI from '../common/debugger.js';
7import { addLibraryPath } from '../common/shared-lib-util.js';
8
9import { deepStrictEqual, strictEqual } from 'assert';
10import { relative } from 'path';
11
12addLibraryPath(process.env);
13
14// Auto-resume on start if the environment variable is defined.
15{
16  const scriptFullPath = _path('debugger', 'break.js');
17  const script = relative(process.cwd(), scriptFullPath);
18
19  const env = {
20    ...process.env,
21  };
22  env.NODE_INSPECT_RESUME_ON_START = '1';
23
24  const cli = startCLI(['--port=0', script], [], {
25    env,
26  });
27
28  await cli.waitForInitialBreak();
29  deepStrictEqual(cli.breakInfo, {
30    filename: script,
31    line: 10,
32  });
33  const code = await cli.quit();
34  strictEqual(code, 0);
35}
36