unexpected token errors when running karma plugin in WebStorm with jasmine and angular directives using external templates

I'm trying to test angular directives that uses an external template with Jasmine running with Karma in WebStorm. I'm using OS X Mavericks and use WebStorm 7.0.2 and Karma version 0.10.2. I'm using the Karma runner in Webstorm that comes with Webstorm 7+.
I cloned Vojta Jina's angular directive testing project from git: https://github.com/vojtajina/ng-directive-testing.git . I haven't made any changes to the karma config file. If I run Karma from WebStorm I get the errors:

/usr/local/bin/node /Applications/WebStorm.app/plugins/js-karma/js_reporter/karma-intellij/lib/intellijRunner.js --karmaPackageDir=/Users/mags/WebstormProjects/node_modules/karma --serverPort=9876 --urlRoot=/
Testing started at 4:11 PM ...

Uncaught SyntaxError: Unexpected token <
at http://localhost:9876/base/tpl/pane.html?1387211367000:1

Uncaught SyntaxError: Unexpected token <
at http://localhost:9876/base/tpl/tabs.html?1387211367000:1

Process finished with exit code 0

If I run karma from terminal or just open a terminal window inside of WebStorm it executes fine:

karma start
WARN [karma]: Port 9876 in use
INFO [karma]: Karma v0.10.2 server started at http://localhost:9877/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 31.0.1650 (Mac OS X 10.9.0)]: Connected on socket X9kMCrZtNco2FEPaSEfb
Chrome 31.0.1650 (Mac OS X 10.9.0): Executed 9 of 9 SUCCESS (0.418 secs / 0.101 secs)

I have installed the karma-ng-html2js-preprocessor before but I think it comes bundled with karma now anyway.

Is there anything that needs to be changed in configuration karma configuration in WebStorm? I have also tried to set it up differently in a separate project without using any of the code from Vojta's repository but I get the same errors when I run it from WebStorm.



Please sign in to leave a comment.