How to debug with vscode?
See original GitHub issueI added ts-jest
to my project and the tests work fine (thx for that by the way! 😀 )
Unfortunately, I cannot properly debug the tests in vscode
. I added the following launch config:
{
"name": "Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js",
"stopOnEntry": false,
"args": ["--runInBand", "--no-cache"],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"console": "internalConsole",
"sourceMaps": true,
"outDir": "${workspaceRoot}/dist/"
},
I can run this config but vscode ignores all breakpoints. It complains:
Breakpoint ignored because generated code not found (source map problem?).
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:25 (3 by maintainers)
Top Results From Across the Web
Debugging in Visual Studio Code
To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS...
Read more >Introduction to Debugging in Visual Studio Code
Debugging is a core feature of Visual Studio Code. In this tutorial, we will show you how to run and debug a program...
Read more >Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >Debugger Extension - Visual Studio Code
Visual Studio Code's debugging architecture allows extension authors to easily integrate existing debuggers into VS Code, while having a common user ...
Read more >VS Code - Debugging - YouTube
In this video we demonstrate the basics of debugging a Node.js app.You can download VS Code at https://code.visualstudio.com.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, I just wanted to add a point to this discussion. I just added the “Jest” (v2.9.2) extension in vs-code and basically it takes care of everything. If you can run Jest, it will do the rest. If you go to the debugger section, it will add a special configuration for debugging Jest tests. Worked the first try for me. Really awesome work. So if you want to combine Jest, ts-jest, vscode and the debugger, this seems like the simplest route!
Also a quick note, you have to turn of coverage collection or your source maps will break