使用resharper和phantom js调试茉莉花测试 [英] Debugging jasmine tests with resharper and phantom js

查看:238
本文介绍了使用resharper和phantom js调试茉莉花测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似的问题已经在前一段时间提到过如何调试茉莉花测试与Resharper?建议在我没有真正的工作(在测试代码中的位置调试器; )。每次运行测试时,会打开一个新的浏览器窗口,并且线程跳过调试器。有什么办法让它工作吗?还有什么办法可以用幻影跑步者和Resharper调试茉莉花测试?

Similar question was already asked some time ago How do you debug Jasmine tests with Resharper? What is suggested there doesn't really work for me (place debugger; in test code). Each time the tests are run, a new browser window opens and thread jumps through debugger. Is there any way to make it work? And also is there any way to debug jasmine tests with phantom runner and Resharper?

提前感谢

推荐答案

要在浏览器中调试,请将以下代码添加到您的js测试文件中。

To debug in the browser, add the code below to your js test file.

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

Resharper不会被通知测试已经完成,所以我们可以在打开的浏览器中设置调试断点(我使用chrome)和F5页面。

Resharper won't be notified that the test has finished so we can set debug breakpoints in the opened browser (I use chrome) and F5 the page.

完成后,在resharper testrunner窗口中停止测试。

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

编辑:

由于Jasmine 2.0需要使用:


Since Jasmine 2.0 you need to use:

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

这篇关于使用resharper和phantom js调试茉莉花测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆