Skip to content

Commit f8e6ee4

Browse files
committed
fixup! test: log more information in debugger tests
1 parent 1140002 commit f8e6ee4

10 files changed

+20
-6
lines changed

lib/internal/debugger/inspect_client.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ class Client extends EventEmitter {
193193
if (payloadBuffer === null || payloadBuffer.length === 0) break;
194194

195195
const payloadStr = payloadBuffer.toString();
196-
if (payloadStr.startsWith('{"method":"Debugger.scriptParsed"')) {
197-
// Do not log Debugger.scriptParsed events because the payloads
198-
// can be huge.
199-
debuglog('< Debugger.scriptParsed ...');
196+
if (payloadStr.startsWith('{"method":"Debugger.scriptParsed"') &&
197+
payloadStr.includes('"url":"node:')) {
198+
// Do not log Debugger.scriptParsed events for internal scripts
199+
// because the payloads can be huge.
200200
} else if (payloadStr.startsWith('{"method":"Debugger.paused"')) {
201-
// Do not log Debugger.paused events because the payloads
201+
// Do not log Debugger.paused payload because the payloads
202202
// can be huge.
203203
debuglog('< Debugger.paused ...');
204204
} else {

test/sequential/test-debugger-backtrace.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010
const path = require('path');
1111

12+
process.env.NODE_DEBUG = 'inspect';
13+
1214
// Display and navigate backtrace.
1315
{
1416
const scriptFullPath = fixtures.path('debugger', 'backtrace.js');

test/sequential/test-debugger-custom-port.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11+
process.env.NODE_DEBUG = 'inspect';
12+
1113
// Custom port.
1214
{
1315
const script = fixtures.path('debugger', 'three-lines.js');

test/sequential/test-debugger-exec-scope.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11+
process.env.NODE_DEBUG = 'inspect';
1112
// exec .scope
1213
{
1314
const cli = startCLI([fixtures.path('debugger/backtrace.js')]);

test/sequential/test-debugger-exec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11+
process.env.NODE_DEBUG = 'inspect';
12+
1113
{
1214

1315
const cli = startCLI([fixtures.path('debugger/alive.js')]);

test/sequential/test-debugger-launch.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11+
process.env.NODE_DEBUG = 'inspect';
12+
1113
{
1214
const script = fixtures.path('debugger', 'three-lines.js');
1315
const cli = startCLI([script]);

test/sequential/test-debugger-pid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010
const { spawn } = require('child_process');
1111

12-
12+
process.env.NODE_DEBUG = 'inspect';
1313
function launchTarget(...args) {
1414
const childProc = spawn(process.execPath, args);
1515
return Promise.resolve(childProc);

test/sequential/test-debugger-random-port-with-inspect-port.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
1010

11+
process.env.NODE_DEBUG = 'inspect';
12+
1113
// Random port with --inspect-port=0.
1214
{
1315
const script = fixtures.path('debugger', 'three-lines.js');

test/sequential/test-debugger-sb-before-load.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const startCLI = require('../common/debugger');
99
const assert = require('assert');
1010
const path = require('path');
1111

12+
process.env.NODE_DEBUG = 'inspect';
13+
1214
// Using sb before loading file.
1315
{
1416
const scriptFullPath = fixtures.path('debugger', 'cjs', 'index.js');

test/sequential/test-debugger-watchers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const fixtures = require('../common/fixtures');
77
const startCLI = require('../common/debugger');
88

99
const assert = require('assert');
10+
process.env.NODE_DEBUG = 'inspect';
1011

1112
// Stepping through breakpoints.
1213
{

0 commit comments

Comments
 (0)