testing in PhpStorm 7 using Karma and Jasmine?

Hi.

So,  sorry for the stupid question, but I haven't used these testing tools  before and wanted to give them a try. I got Karma, Node and Jasmine  plugins installed in PhpStorm 7, and was following some tutorials to see  how it works. Now, in the tutorials the guys have some green "run"  button in PhpStorm to execute the tests. My run button is greyed out. I  don't know why, and the tutorials say nothing about said. I probably  forgot to check some checkbox or install some Plugin or something?

I  can use the built-in terminal to have Karma create a config file. I  have a Jasmine library so that I got code completion for the tests. But I  just can't execute the files. They are in the correct directory, they got the correct names, I don't know what's wrong. :(

Thanks in advance for any useful advice. :)

4 comments

Hello!


you need to install karma plugin - it's not bundled with PHPStorm 7. In Settings/plugins press 'Browse repositories...' button and type 'karma' in the search field to quickly locate the plugin, double-click to download and install. You will also need Node.js plugin (if it's not yet installed). After installing you'll be able to create run configurations and run karma from the right-click menu of karma config file.
I'm attaching a simple project preconfigured to use karma+jasmine - hope it helps.



Attachment(s):
karma_jasmine.zip
0

Hi.

Thanks for your reply. I have both Karma and Node.js installed. I uninstalled Karma and reinstalled it, to make sure it's the correct version and everything. Still, the "run", "debug" and "run with coverage" buttons are greyed out and can't be clicked on, while I have some js file open.

0

Hello!

can you run karma using the project I've provided? Do you have any karma run configurations defined?

0

Hi.

Thanks for your help and sorry for my late reply. It seems to work now. I didn't set the debug configurations correctly.

0

Please sign in to leave a comment.