Jest tests won't complete properly when debugging
See original GitHub issueHi there, I gave the new debugger a quick try with my Jest tests to try parallel testing (no --runInBand) having noticed https://github.com/microsoft/vscode-js-debug/issues/214.
First thing I noticed is compared to a parallel run without the debugger speed seems very variable. Sometimes the tests don’t seem to finish at all… other times they take just a bit longer than a non-debug run.
Also even after a successful run Jest doesn’t close properly - last message on terminal is as below and still-active parent process needs to be stopped to finish debugging.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
I can’t share my project but tests use Puppeteer (automated web testing) so are quite heavy, maybe that is an issue? On the other hand, running tests in parallel without the debugger works fine on the command line.
My config is:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests (All)",
"type": "node",
"request": "launch",
//"trace": true,
"runtimeArgs": [
//"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
//"--runInBand",
"--updateSnapshot",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Thanks and no problem, I’ll keep observing things and open a new issue for anything else I see independent of the Node.js issue.
Okay, thanks. I brought this up in an issue under Node.js. Closing this here as it’ll be an upstream fix.