Karma launch throws error

Hello, I have an AngularJS project, I use Karma + Jasmine for testing. I can execute the tests using command line, however when I run those tests in WebStorm, it gives this error:

Uncaught TypeError: Cannot read property 'http://localhost:9876' of undefined
at http://localhost:9876/base/node_modules/karma-jasmine/lib/adapter.js?8758b57ed804b1772f97ced0c9165fbc2ae4b92f:48

If I try to debug unit tests instead - works fine.

No mather what browser do I use, I'm quite new to Karma / Jasmine, but I just don't know what is going on.

Thanks in an advance.


Comment actions Permalink

Looks similar to http://stackoverflow.com/questions/32451135/issue-setting-up-karma-jasmine-with-angular.

What karma version do you use? Do you use local or global karma when launching from WebStorm/in command line? When using local package, you need to make sure that all required modules are installed locally - and vice versa

Comment actions Permalink

Thank you for your reply. I just solved the problem, we were messing with Run/Debug Configuration and there was referenced wrong Karma package, it was version v0.13.21.

So I switched back to previous one, which is version v0.10.9 and everything works just fine.

I wasn't installing this computer so I don't know why are there two, I guess the second one is corrupted. I don't know. But thank you for your help!


Please sign in to leave a comment.