已断开连接(1次),因为使用Karma-Jasmine在10000毫秒内没有消息 [英] Disconnected (1 times), because no message in 10000 ms using Karma-Jasmine

查看:84
本文介绍了已断开连接(1次),因为使用Karma-Jasmine在10000毫秒内没有消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将K玛赛跑者与茉莉花配合使用.完成所有配置后,我在终端上键入以下命令:

Using Karma runner with jasmine. After all the configuration done, I type on terminal the below command:

karma start public/javascripts/karma.conf.js

但是我的浏览器关闭时出现以下错误.

But I am getting the below error where my browser is getting closed.

INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Connected on socket hDO3pMdVNGcBMDx4FI0w with id 60695552
WARN [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Disconnected (1 times), because no message in 10000 ms.

我将Karma配置中的browserNoActivityTimeout更改为50秒,但仍然是相同的错误. Safari和Chrome都在发生这种情况.我没有尝试其他浏览器.

I changed the browserNoActivityTimeout in Karma config to 50 seconds but still the same error. Its happening for both safari and chrome. I have not tried for other browsers.

在同一问题上,我找不到来自其他github线程的大量输入.就像更改端口也无济于事.

I could not find much input fro other github threads on the same issue. Like changing port does not help either.

Karma Version: 0.12.16
Nodejs version: 0.10.22
Mac OS: 10.9.2

有人遇到过同样的问题吗?

Has anyone faced the same issue?

推荐答案

找到了问题并解决了.这是因为requirejs未包含在因果配置中,因为我的所有控制器都已由requirejs加载.在将其包含在框架中之后,问题就消失了.在那之后,我遇到了其他一些问题,但是能够解决并运行一个示例测试用例.我必须在业力conf文件的框架部分中添加"requirejs":框架:['jasmine','requirejs']

found the issue and resolve it. This was because requirejs was not included in the karma config where as all my controllers are getting loaded by requirejs. After including it in the frameworks, the issue was gone. I faced few more issues after that but was able to resolve and run a sample test case. i had to add "requirejs" in frameworks section in the karma conf file:: frameworks: ['jasmine', 'requirejs']

这篇关于已断开连接(1次),因为使用Karma-Jasmine在10000毫秒内没有消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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