-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Expand file tree
/
Copy pathtest-debugger-probe-text-special-values.js
More file actions
69 lines (65 loc) · 1.76 KB
/
test-debugger-probe-text-special-values.js
File metadata and controls
69 lines (65 loc) · 1.76 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
66
67
68
69
// This tests debugger probe text output for stable special-cased values.
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const { spawnSyncAndAssert } = require('../common/child_process');
const {
assertProbeText,
probeTypesScript,
} = require('../common/debugger-probe');
const location = `${probeTypesScript}:17`;
spawnSyncAndAssert(process.execPath, [
'inspect',
'--probe', location,
'--expr', 'stringValue',
'--probe', location,
'--expr', 'booleanValue',
'--probe', location,
'--expr', 'undefinedValue',
'--probe', location,
'--expr', 'nullValue',
'--probe', location,
'--expr', 'nanValue',
'--probe', location,
'--expr', 'bigintValue',
'--probe', location,
'--expr', 'symbolValue',
'--probe', location,
'--expr', 'functionValue',
'--probe', location,
'--expr', 'objectValue',
'--probe', location,
'--expr', 'arrayValue',
'--probe', location,
'--expr', 'errorValue',
probeTypesScript,
], {
stdout(output) {
assertProbeText(output, [
`Hit 1 at ${location}`,
' stringValue = "hello"',
`Hit 1 at ${location}`,
' booleanValue = true',
`Hit 1 at ${location}`,
' undefinedValue = undefined',
`Hit 1 at ${location}`,
' nullValue = null',
`Hit 1 at ${location}`,
' nanValue = NaN',
`Hit 1 at ${location}`,
' bigintValue = 1n',
`Hit 1 at ${location}`,
' symbolValue = Symbol(tag)',
`Hit 1 at ${location}`,
' functionValue = () => 1',
`Hit 1 at ${location}`,
' objectValue = {alpha: 1, beta: "two"}',
`Hit 1 at ${location}`,
' arrayValue = [1, "two", 3]',
`Hit 1 at ${location}`,
' errorValue = Error: boom',
'Completed',
].join('\n'));
},
trim: true,
});