ts-jest-sample icon indicating copy to clipboard operation
ts-jest-sample copied to clipboard

Launch setting not working

Open berglandper opened this issue 6 years ago • 4 comments

Thanks for pulling this together. It helped me set this up to work. The only thing that I couldn't get to work was the launch setting, but I found an official snippet instead that DID work: https://github.com/Microsoft/vscode-recipes/tree/master/debugging-jest-tests

berglandper avatar Apr 14 '18 11:04 berglandper

I don't really see a difference. What was the error you rant into? The only difference I see is that --inspect-brk. I'm currently using that with my current project without issue. I wonder if it is sensitive to which version of Node you are running? I'm running v8.9.4, for reference.

xogeny avatar Apr 15 '18 20:04 xogeny

Yeah well I don’t know really. All I know is that with the settings in this project I got a connection error that didn’t happen with the ms snippet. Go figure maybe?

berglandper avatar Apr 15 '18 20:04 berglandper

Well what version of Node are you running? IIRC, there were changes to how the debugger functioned between 8 and 6. So if you are using 6, that could explain it.

xogeny avatar Apr 16 '18 13:04 xogeny

I had the same issue. I had to copy that configuration to make it work:

{
        "type": "node",
        "request": "launch",
        "name": "Jest All",
        "program": "${workspaceFolder}/node_modules/jest/bin/jest",
        "args": ["--runInBand"],
        "console": "integratedTerminal",
        "internalConsoleOptions": "neverOpen"
      },
      {
        "type": "node",
        "request": "launch",
        "name": "Jest Current File",
        "program": "${workspaceFolder}/node_modules/jest/bin/jest",
        "args": ["${relativeFile}"],
        "console": "integratedTerminal",
        "internalConsoleOptions": "neverOpen"
      }

I'm using npm 6.1.0 and node 8.11.2

darewreck54 avatar Jun 02 '18 18:06 darewreck54