Disconnected (1 times), because no message in 10000 ms using Karma-Jasmine

Priyabrat Nanda picture Priyabrat Nanda · May 15, 2014 · Viewed 12.4k times · Source

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.

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.

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?

Answer

Priyabrat Nanda picture Priyabrat Nanda · Nov 8, 2014

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']