Closed lakartoza closed 3 years ago
I followed through the issues #175 and #585. I have had no luck...
My .scripts
point to the correct files. If I click the link that comes from .scripts
, VS Code will opens up the instance of that file, "c:\Users.......{workspace}\src\app.component.spec.ts" and the breakpoint works there. So it's like pointing to the right place, but the break points don't hit when I use it from ng test
.
Some help would be very much appreciated.
Same here - breakpoints are set okay (full red dots) , but as soon as I start the debug run, they become unbound (white/hollow) and do not get hit. Tried variations (as proposed) of the debug configuration, but without success.
I had the same problem.
I have the same problem. Tried bunch of different solutions without any luck.
@chrisdias any luck making this work?
Same problem.
It might be related to the Path mapping to the launch file being missing. Just add this line along with the instructions found in the Angular CLI for the ng test. I also opened a issue here which explain it a little more: Unit Test Issue
"pathMapping": {
"/_karma_webpack_": "${workspaceFolder}"
}
@tasdevani21 I tried, but it doesn't work.
@tasdevani21 idea led me to the right solution. Add this path mapping to your launch.json
:
"pathMapping": {
"/_karma_webpack_": "${workspaceFolder}"
}
@tasdevani21 brilliant. You just saved me so much frustration tonight. Thanks!
@tasdevani21 i added the snippet to launch.json but still code doesn't stop at breakpoint. it says Breakpoint set but not yet bound
This answer here seems to be working fine with latest updates.
Your launch.json
should be as follows
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"/./*": "${webRoot}/*",
"/src/*": "${webRoot}/*",
"/*": "*",
"/./~/*": "${webRoot}/node_modules/*"
}
}
duplicates Duplicates https://github.com/microsoft/vscode-recipes/issues/225
I can't debug my tests following the instructions on Angular CLI.
When I run my "ng test" launcher, my breakpoints say "Breakpoint set but not yet bound".
1) Debugging works with my chrome browser if I initiate my breakpoint on my Chrome dev tools. 2) ng serve debugging works fine.
Context:
Does anyone else have this issue?