vscode-jest
vscode-jest copied to clipboard
Cannot debug test
Environment
-
node -v
: v8.12.0 -
npm -v
: 6.4.1 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): [email protected] [email protected] - your vscode-jest settings if customized:
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": [
"test",
"--env=jsdom",
"--coverage",
"--runInBand"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/react-scripts",
"protocol": "inspector"
}
- Operating system: Microsoft Windows 10 Enterprise 10.0.18362 Build 18362
Prerequisite
- are you able to run jest test from command line? Yes
- how do you run your tests from command line? (for example:
npm run test
ornode_modules/.bin/jest
) npm test
Steps to Reproduce
In a test Click on the Debug CodeLens.
Relevant Debug Info
Other than debug not working Jest looks like it's working. It start when I open vscode. All test runs. I have the green circle next to test that succeed.
Expected Behavior
Debug doesn't start. Instead I have this error.
Here's the bottom of the stack of the error
Actual Behavior
Debug should works and my breakpoint hit.
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
@maubin-kl using breakpoint on visual studio is hard, you need a lot of configuration, instead using webstorm you need to do nothing : simply put a breakpoint and debug your code.
@maubin-kl actually using your configuration I was able to inline Debug a failing test. Thank you.