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

爷,独闯天下 提交于 2019-12-01 02:32:19

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

I solved this issue by update my node from 10.4 to 12.2. It appears the socket.io that karma pull via npm was not compiling. I had run karma on two other machines just fine but the two with the 10.4 version of node had the warning below:

karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\node_modules\nan\nan.h(1103): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data

karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\bufferutil.vcxproj warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data

karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\bufferutil.vcxproj]

I did not bother tracking down whether it was the node version that was the problem or the npm version since npm gets upgraded by default when one upgrades node. Either way, upgrading node fixed the issue for me. If you have a hard dependency to 10.4 or whatever version of node you are one, try updating just your npm to a compartible version.

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