mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Add more log points in the probe mode and enable the debuglog int the probe mode tests. Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63663 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
// This tests debugger probe text output for stable special-cased values.
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
const { assertProbeText } = require('../common/debugger-probe');
|
|
const cwd = fixtures.path('debugger');
|
|
const probeArg = 'probe-types.js:17';
|
|
const hitText = `${fixtures.fileURL('debugger', 'probe-types.js').href}:17:1`;
|
|
|
|
spawnSyncAndAssert(process.execPath, [
|
|
'inspect',
|
|
'--probe', probeArg,
|
|
'--expr', 'stringValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'booleanValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'undefinedValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'nullValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'nanValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'bigintValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'symbolValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'functionValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'objectValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'arrayValue',
|
|
'--probe', probeArg,
|
|
'--expr', 'errorValue',
|
|
'probe-types.js',
|
|
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
|
|
stdout(output) {
|
|
assertProbeText(output, [
|
|
`Hit 1 at ${hitText}`,
|
|
' stringValue = "hello"',
|
|
`Hit 1 at ${hitText}`,
|
|
' booleanValue = true',
|
|
`Hit 1 at ${hitText}`,
|
|
' undefinedValue = undefined',
|
|
`Hit 1 at ${hitText}`,
|
|
' nullValue = null',
|
|
`Hit 1 at ${hitText}`,
|
|
' nanValue = NaN',
|
|
`Hit 1 at ${hitText}`,
|
|
' bigintValue = 1n',
|
|
`Hit 1 at ${hitText}`,
|
|
' symbolValue = Symbol(tag)',
|
|
`Hit 1 at ${hitText}`,
|
|
' functionValue = () => 1',
|
|
`Hit 1 at ${hitText}`,
|
|
' objectValue = {alpha: 1, beta: "two"}',
|
|
`Hit 1 at ${hitText}`,
|
|
' arrayValue = [1, "two", 3]',
|
|
`Hit 1 at ${hitText}`,
|
|
' errorValue = Error: boom',
|
|
'Completed',
|
|
].join('\n'));
|
|
},
|
|
trim: true,
|
|
});
|