How to debug PhantomJS when running through Karma

自作多情 提交于 2019-12-09 04:37:39

问题


I test through Jasmine, Karma and a variety of browsers. I'm currently debugging a test that fails only in 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.

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.

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.


回答1:


I struggled mightily with this, it was not straightforward.

I ended up proposing a change to karma-phantomjs-launcher. It was merged and is now in the latest versions.



来源:https://stackoverflow.com/questions/22923635/how-to-debug-phantomjs-when-running-through-karma

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!