vscode-jest icon indicating copy to clipboard operation
vscode-jest copied to clipboard

Cannot debug test

Open maubin-kl opened this issue 5 years ago • 2 comments

Environment

  1. node -v: v8.12.0
  2. npm -v: 6.4.1
  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): [email protected] [email protected]
  4. 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"
}
  1. 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 or node_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.

image

Here's the bottom of the stack of the error

image

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 avatar Sep 27 '19 14:09 maubin-kl

@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.

andreabisello avatar Dec 27 '19 11:12 andreabisello

@maubin-kl actually using your configuration I was able to inline Debug a failing test. Thank you. image

richardaum avatar Sep 20 '20 16:09 richardaum