How do you debug Jasmine tests with Resharper?

前端 未结 4 1111
野趣味
野趣味 2020-12-23 17:47

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

4条回答
  •  醉梦人生
    2020-12-23 18:19

    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.

提交回复
热议问题