Is there anything that indicates whether I am in run test or debug test?
I'm running tests against a vscode extension and while I can set my test vscode to inspect, usually the debugger doesn't attach until after the test has run. I could introduce a delay but I'd much rather have some kind of indicator either by environment variable or by arg passed to my launcher script that we are in debug mode vs. run mode so I can instruct my vscode extension instance to --inspect-brk instead of just --inspect. Thanks!
Is there anything that indicates whether I am in run test or debug test?
I'm running tests against a vscode extension and while I can set my test vscode to inspect, usually the debugger doesn't attach until after the test has run. I could introduce a delay but I'd much rather have some kind of indicator either by environment variable or by arg passed to my launcher script that we are in debug mode vs. run mode so I can instruct my vscode extension instance to
--inspect-brk
instead of just--inspect
. Thanks!EDIT: Looks like this is the intended behavior, but it only works if launcherscript is not specified. I think an env var would be appropriate to pass to the run process if debug is true, like
__TEST_MOCHA_ADAPTER_DEBUG=true
https://github.com/hbenl/vscode-mocha-test-adapter/blob/f519292b7b0039a9f27ec544157953a9d9e3aa42/src/core.ts#L279-L281Alternative
Start the debugging config before launching the process, so it hopefully attaches quickly, may need to increase default attach timeout.