How do you debug Jasmine tests with Resharper?
jasmine, javascript, resharper, unit-testing
Solution
Try to use `debugger` keyword. Simply add the following line to the code you want to debug (perhaps into the spec):
debugger;
It invokes any available debugging functionality. It doesn't work in IE but works pretty well in Chrome (you wrote you use it so I guess it's enough just for debugging).
Of course, after that be sure to remove the `debugger` keyword! Perhaps there is no really simple way how to avoid it in production code in general (in case you will use it not only in spesc) but if you are interested in this SO question could be helpful.
Problem
I can't find a way to debug (walk through) JavaScript code when running Jasmine tests with Resharper in Visual Studio 2012. I tried running tests with browser (Chrome) but the test runner closes the port as soon as the test is run and so I cannot put a breakpoint in the code. Also tried running in Internet Explorer and put breakpoints in Visual Studio but it won't attach to the process. My test has a lot of ///reference scripts that Resharper includes automatically in the test runner but I don't want to manually do this for every test that I want to debug. Please help me understand this. If you have a jasmine test that is failing, then how do you debug it?