nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Cannot debug node.js test runner #4314

Closed bitliner closed 6 months ago

bitliner commented 6 months ago

Details

I'm running tests programmatically with run({ concurrency: true, files })

However the debugger (chrome inspect) gets stuck, like if the child processes launched by the node.js test runner cannot be debugger.

Node.js version

v20.9.0

Example code

No response

Operating system

Mac OSx

Scope

node test debugger

Module and version

CommonJS

bitliner commented 6 months ago

Solved.

Since the test runner creates child processes, and since they have the debugger attached to port numbers different than the parent process, I had to configure Chrome to discover the debugger on those ports.

In other words, from chrome:inspect I had to click Configure like the following:

image