I am trying to debug when running nyc instead of just while running the mocha tests, so I won't have to run tests twice each time.
VSCode runs the coverage and shows it to me, but it will not stop or verify breakpoints, how do I set it to properly debug?
Is it even possible?
My launch configuration:
{
"type": "node",
"request": "launch",
"name": "Coverge",
"program": "/usr/local/bin/nyc",
"args": [
"${workspaceFolder}/node_modules/mocha/bin/_mocha",
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/tests/*/*"
],
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js"
],
"env": {},
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart"
}
nyc
runsmocha
as a sub-process and Visual Studio Code is only attaching to thenyc
process with no debug ability on thenyc
sub-process. Personally I fell back to two separate runs: runnyc
without debug for coverage reporting then separately runmocha
for debugging. Good luck! P.S. Thanks for theoutputCapture: std
- without this the above has no output in VS Code for me. – Lariat