This post originated from an RSS feed registered with Java Buzz
by Andrej Koelewijn.
Original Post: Debugging with webstorm and karma
Feed Title: Andrej Koelewijn
Feed URL: http://feeds.feedburner.com/AndrejKoelewijn
Feed Description: On Oracle, Java and OpenSource
I think this is not mentioned in Vojta’s testacular video, or maybe I missed it, but i had to install JetBrain’s chrome debugger plugin to be able to debug tests run with Karma in Webstorm.
describe('HelloWorld controller',function(){
it('Should reset name value',function(){
var scope = {},
ctrl = new HelloWorldCtrl(scope);
scope.name = "john";
scope.reset();
expect(scope.name).toBe("");
});
});
Create a karma configuration file:
$> karma init config/karma.conf.js
Which testing framework do you want to use ?
> jasmine
Do you want to use Require.js ?
> no
Do you want to capture a browser automatically ?
> Chrome
Which files do you want to test ?
> test/**/*Spec.js
Any files you want to exclude ?
>
Do you want Testacular to watch all the files and run the tests on change ?
> yes
Config file generated at "/home/akoelewijn/projects/training-angularjs/test-karma/config/karma.conf.js".