🚀 Feature: Disable timeout when require('node:inspector').url() !== undefined
It would be nice to disable timeout when one launch a test within node debugger.
It would prevent test from timing out during debugging, which is frustrating.
A way could be
if (require('node:inspector').url() !== undefined) this.timeout(0);
Agreed
I noticed that mocha checks if --inspect flag is set:
https://github.com/mochajs/mocha/commit/d4adfa6364dff21c37e8632c3bfc9288c9938f42
however, when run in vscode test explorer, that flag isn't set, even when debugging.
Hence the more thorough check proposed above.
afaik, vscode uses the NODE_OPTIONS env arg instead of the flag
so, mocha should check this
Yes, OTOH require('node:inspector').url() !== undefined is independent of the way it got in debugger mode.
This seems like a useful feature, to the point where other test runners would probably do the same. I don't recall hitting this bug in Jest or Vitest so I'm guessing they might do some handling about it (or I just don't remember very well - also plausible!). Let's get a comparison table to see how other popular test frameworks handle this. If they do, then it'd be good to know what the list of "I seem to be running in debugger mode" conditions they check for.