通过 Karma 运行时如何调试 PhantomJS [英] How to debug PhantomJS when running through Karma

查看:24
本文介绍了通过 Karma 运行时如何调试 PhantomJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 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 正在命中的业力服务器),但是当我尝试调试该位置时,它没有显示任何源文件或 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屋!

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