forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-debugger-probe-narrow-suffix.js
More file actions
40 lines (36 loc) · 1.11 KB
/
Copy pathtest-debugger-probe-narrow-suffix.js
File metadata and controls
40 lines (36 loc) · 1.11 KB
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
37
38
39
40
// Tests that a path-qualified suffix narrows the match to a single script.
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const { spawnSyncAndAssert } = require('../common/child_process');
const { assertProbeJson } = require('../common/debugger-probe');
const cwd = fixtures.path('debugger');
const urlA = fixtures.fileURL('debugger', 'probe-multi-a', 'utils.js').href;
spawnSyncAndAssert(process.execPath, [
'inspect',
'--json',
'--probe', 'probe-multi-a/utils.js:5',
'--expr', 'b',
'probe-multi-entry.js',
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
stdout(output) {
assertProbeJson(output, {
v: 2,
probes: [
{ expr: 'b', target: { suffix: 'probe-multi-a/utils.js', line: 5 } },
],
results: [
{
probe: 0,
event: 'hit',
hit: 1,
location: { url: urlA, line: 5, column: 3 },
result: { type: 'number', value: 2, description: '2' },
},
{ event: 'completed' },
],
});
},
trim: true,
});