Phantom JS Karma runner连接但不在C9.io中执行测试

时间:2015-03-14 18:59:12

标签: karma-runner karma-jasmine cloud9-ide

我按照Karma网站的说明在Cloud9 IDE中运行Karma(http://karma-runner.github.io/0.10/plus/cloud9.html

我的karma.config正确包含:

    hostname: process.env.IP,
    port: process.env.PORT,
    runnerPort: 0,

我的终端输出:

Running "karma:test" (karma) task
INFO [karma]: Karma v0.10.10 server started at http://0.0.0.0:8080/
INFO [launcher]: Starting browser PhantomJS
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again.

我能够看到“Karma开始...”的字样  http://..c9.io/

但是,我在控制台中收到以下错误:

 Mixed Content: The page at 'https://test-raptoria.c9.io/?  
 _c9_id=livepreview24&_c9_host=https://ide.c9.io' was loaded 
 over HTTPS, but requested an insecure XMLHttpRequest 
 endpoint http://test-raptoria.c9.io/socket.io/
 EIO=3&transport=polling&t=1426358810471-0'. This
 request has been blocked; the content must be served over HTTPS.

关于如何解决这个问题的任何想法?似乎请求被阻止了..

我在这里分享了我的工作区: https://ide.c9.io/raptoria/test

谢谢!

2 个答案:

答案 0 :(得分:0)

您是否可以尝试将请求更改为socket.io为https?如果无法做到这一点,请尝试使用http而不是https加载test-raptoria.c9.io。

答案 1 :(得分:0)

我从test下载了整个工作区(没有数据文件夹和依赖项),并创建了一个名为simple的新工作区。我跑了' grunt test'再次,它的工作原理。我必须以某种方式破坏我的旧工作区。

问题解决了! 谢谢你帮助我调查一下。