How do you debug Jasmine tests with Resharper?

前端 未结 4 1140
野趣味
野趣味 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:29

    Since I didn't got debugger; to work I found another solution. By adding the following to my test, resharper won't be notified that the test has finished so we can set debug breakpoints in the opened browser (I use chrome) and update (F5) the page.

    jasmine.getEnv().currentRunner_.finishCallback = function () {};
    

    Since Jasmine 2.0 you need to use:

    ReSharperReporter.prototype.jasmineDone = function () { };
    

    Stop the tests in resharper testrunner window when you're done.

    Also this can be done for QUnit

    QUnit.moduleDone = function(){}
    

提交回复
热议问题