forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-debugger-auto-resume.js
More file actions
36 lines (28 loc) · 913 Bytes
/
test-debugger-auto-resume.js
File metadata and controls
36 lines (28 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');
const { addLibraryPath } = require('../common/shared-lib-util');
const assert = require('assert');
const path = require('path');
addLibraryPath(process.env);
// Auto-resume on start if the environment variable is defined.
{
const scriptFullPath = fixtures.path('debugger', 'break.js');
const script = path.relative(process.cwd(), scriptFullPath);
const env = { ...process.env };
env.NODE_INSPECT_RESUME_ON_START = '1';
const cli = startCLI([script], [], { env });
cli.waitForInitialBreak()
.then(() => {
assert.deepStrictEqual(
cli.breakInfo,
{ filename: script, line: 10 },
);
})
.then(() => cli.quit())
.then((code) => {
assert.strictEqual(code, 0);
});
}