如何通过Karma运行时调试PhantomJS [英] How to debug PhantomJS when running through Karma
问题描述
我通过Jasmine,Karma和各种浏览器进行测试。我正在调试只在PhantomJS中失败的测试。
I test through Jasmine, Karma and a variety of browsers. I'm currently debugging a test that fails only in PhantomJS.
我想调试这个调用,所以我在运行的karma中设置了一个自定义PhantomJS启动器它打开了调试端口。
I'd like to debug this call, so I've setup a custom PhantomJS launcher in karma that runs it with the debug port open.
我可以通过该端口访问Chrome中的远程调试器,但是,它似乎对我的任何测试文件一无所知。它报告了一个about:blank和一个localhost:9876(Phantom正在攻击的karma服务器)但是当我尝试调试该位置时,它没有显示任何源文件或Jasmine规范文件。
I'm able to access the remote debugger in Chrome through that port, however, it seems to know nothing about any of my test files. It reports an "about:blank" and a "localhost:9876" (the karma server that Phantom is hitting) but when I try to debug that location, it shows none of the source files or Jasmine spec files.
还有其他人看到过这种行为吗?我已经阅读了有关远程调试功能的PhantomJS文档,他们没有对此问题有所了解,AFAIK。
Has anyone else seen this behavior? I've read the PhantomJS docs on the remote debugging feature and they don't shed any light on this issue, AFAIK.
推荐答案
我对此非常挣扎,这并不简单。
I struggled mightily with this, it was not straightforward.
我最终提议改变karma-phantomjs-launcher 。它已合并,现在是最新版本。
I ended up proposing a change to karma-phantomjs-launcher. It was merged and is now in the latest versions.
这篇关于如何通过Karma运行时调试PhantomJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!