Skip to content

Commit

Permalink
fixup! test: log more information in debugger tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Aug 23, 2022
1 parent 1140002 commit f8e6ee4
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/internal/debugger/inspect_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ class Client extends EventEmitter {
if (payloadBuffer === null || payloadBuffer.length === 0) break;

const payloadStr = payloadBuffer.toString();
if (payloadStr.startsWith('{"method":"Debugger.scriptParsed"')) {
// Do not log Debugger.scriptParsed events because the payloads
// can be huge.
debuglog('< Debugger.scriptParsed ...');
if (payloadStr.startsWith('{"method":"Debugger.scriptParsed"') &&
payloadStr.includes('"url":"node:')) {
// Do not log Debugger.scriptParsed events for internal scripts
// because the payloads can be huge.
} else if (payloadStr.startsWith('{"method":"Debugger.paused"')) {
// Do not log Debugger.paused events because the payloads
// Do not log Debugger.paused payload because the payloads
// can be huge.
debuglog('< Debugger.paused ...');
} else {
Expand Down
2 changes: 2 additions & 0 deletions test/sequential/test-debugger-backtrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const startCLI = require('../common/debugger');
const assert = require('assert');
const path = require('path');

process.env.NODE_DEBUG = 'inspect';

// Display and navigate backtrace.
{
const scriptFullPath = fixtures.path('debugger', 'backtrace.js');
Expand Down
2 changes: 2 additions & 0 deletions test/sequential/test-debugger-custom-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

process.env.NODE_DEBUG = 'inspect';

// Custom port.
{
const script = fixtures.path('debugger', 'three-lines.js');
Expand Down
1 change: 1 addition & 0 deletions test/sequential/test-debugger-exec-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

process.env.NODE_DEBUG = 'inspect';
// exec .scope
{
const cli = startCLI([fixtures.path('debugger/backtrace.js')]);
Expand Down
2 changes: 2 additions & 0 deletions test/sequential/test-debugger-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

process.env.NODE_DEBUG = 'inspect';

{

const cli = startCLI([fixtures.path('debugger/alive.js')]);
Expand Down
2 changes: 2 additions & 0 deletions test/sequential/test-debugger-launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

process.env.NODE_DEBUG = 'inspect';

{
const script = fixtures.path('debugger', 'three-lines.js');
const cli = startCLI([script]);
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-debugger-pid.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const startCLI = require('../common/debugger');
const assert = require('assert');
const { spawn } = require('child_process');


process.env.NODE_DEBUG = 'inspect';
function launchTarget(...args) {
const childProc = spawn(process.execPath, args);
return Promise.resolve(childProc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const startCLI = require('../common/debugger');

const assert = require('assert');

process.env.NODE_DEBUG = 'inspect';

// Random port with --inspect-port=0.
{
const script = fixtures.path('debugger', 'three-lines.js');
Expand Down
2 changes: 2 additions & 0 deletions test/sequential/test-debugger-sb-before-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const startCLI = require('../common/debugger');
const assert = require('assert');
const path = require('path');

process.env.NODE_DEBUG = 'inspect';

// Using sb before loading file.
{
const scriptFullPath = fixtures.path('debugger', 'cjs', 'index.js');
Expand Down
1 change: 1 addition & 0 deletions test/sequential/test-debugger-watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fixtures = require('../common/fixtures');
const startCLI = require('../common/debugger');

const assert = require('assert');
process.env.NODE_DEBUG = 'inspect';

// Stepping through breakpoints.
{
Expand Down

0 comments on commit f8e6ee4

Please sign in to comment.