2
votes

I'm new to angular unit testing and chutzpah. I have everything set up (angular libraries, jasmine, sinon, angular-mocks, etc.) and running but I realize as I'm writing my unit tests that debugging them is a pain using chutzpah because I'm not able to attach a debugger (or at least I don't know how) and step through my angular code. Is there a way to achieve this without ditching chutzpah and running the unit tests in the browser using jasmine?

1
You can open in browser from chutzpah and it will stop on the debugger break pointsPSL
So I take it that the answer is "no" then. There's no way to debug the unit test using the VS debugger and I would have to use the browser's js debugger?mikelt21
yes you have to use the Browsers Debuggersquadwuschel
I right-clicked on the test file and chose Chutpah's "Open in browser" option. I set a breakpoint in Visual Studio and also added a "debugger" statement. But the breakpoint is not hit. Does something else need to be done? Also can the Jasmine test code itself be debugged this way?John Pankowicz
Breakpoints in Visual Studio will not get hit. You have to set the breakpoint in your browser's script debugger.mikelt21

1 Answers

1
votes

Version 4.1.0 of Chutzpah adds integrated VS debugging. You can set breakpoints in your JS files and launch using the Visual Studio Debugger from the context menu:

enter image description here