-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathtest-debugger-probe-json.js
More file actions
65 lines (62 loc) · 1.61 KB
/
test-debugger-probe-json.js
File metadata and controls
65 lines (62 loc) · 1.61 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// This tests debugger probe JSON output for duplicate and multi-probe hits.
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const { spawnSyncAndAssert } = require('../common/child_process');
const { assertProbeJson, probeScript } = require('../common/debugger-probe');
spawnSyncAndAssert(process.execPath, [
'inspect',
'--json',
'--probe', `${probeScript}:8`,
'--expr', 'index',
'--probe', `${probeScript}:8`,
'--expr', 'total',
'--probe', `${probeScript}:12`,
'--expr', 'finalValue',
probeScript,
], {
stdout(output) {
assertProbeJson(output, {
v: 1,
probes: [
{ expr: 'index', target: [probeScript, 8] },
{ expr: 'total', target: [probeScript, 8] },
{ expr: 'finalValue', target: [probeScript, 12] },
],
results: [
{
probe: 0,
event: 'hit',
hit: 1,
result: { type: 'number', value: 0, description: '0' },
},
{
probe: 1,
event: 'hit',
hit: 1,
result: { type: 'number', value: 0, description: '0' },
},
{
probe: 0,
event: 'hit',
hit: 2,
result: { type: 'number', value: 1, description: '1' },
},
{
probe: 1,
event: 'hit',
hit: 2,
result: { type: 'number', value: 40, description: '40' },
},
{
probe: 2,
event: 'hit',
hit: 1,
result: { type: 'number', value: 81, description: '81' },
},
{ event: 'completed' },
],
});
},
trim: true,
});