Help! Can't recognise Jasmine methods in Webstorm
Hi,
Can someone please help, I've lost too many hours to this!
One of my big reasons for buying Webstorm 7 (newbie alert) was for it's integrated Karma test runner, which is great and all.
And I also want to use Jasmine to write all my tests... however, I've watched this video a 100 times:
http://www.youtube.com/watch?feature=player_embedded&v=oyWW_V4wALs#t=113
...it seems so infuriatingly easy?
My actual tests run fine... but I've got the red lines telling me the Jasmine basic methods of "describe", "it", "expect" etc. are "not defined".
Try as I may, with the libraries, scopes and watching those videos... I just can't get the .js files from \karma-jasmine\lib to be recognised, and it's driving me mad, because once that's resolved, I can see only a good things ahead.
Just to confirm...
I'm using Node.js on Windows, if either/both of those things complicate matters?
I've used NPM to install "karma", which following the video means I need to ensure the 3 files (adapter.js, index.js, jasmine.js) from the \karma-jasmine\lib are part of a library which is in scope of the file containing my tests... which it all seems to be.
And again, the tests actually run fine, my issue is all the redness in the editor screaming it doesn't know the Jasmine methods.
Any help (very) gratefully received... Webstorm looks such a brilliant tool... this small bump is really stopping us throwing it into battle.
Many thanks
Tim
Please sign in to leave a comment.
Hi Tim,
works fine for me - I have ~\AppData\Roaming\npm\node_modules\jasmine-node\lib\jasmine-node\jasmine-1.3.1.js set up as a javascript library enabled for my project, and describe, it, etc. methods are correctly resolved - see the attached screenshots
Attachment(s):
jasmine_lib.png
describe.png
Hi Elena,
Many thanks for this...
I was struggling with JSHint (after reading-up... I've disabled it for now), and something as daft as a colour difference of global functions compared with the settings in the video)
Did warn you I was a newbie... :-)
Thanks for your swift response and screenshots, really appreciated.
Kind regards
Tim
So I've done this in Webstorm 7 but this doesn't appear to be working. Does anyone have any suggestions?
Hi Jacob,

Not sure if this is the perfect way of doing things, but if you get to the "Manage libraries in scope" dialog... these are the libs I needed to add/enable:
Have you got something similar?
Tim
Here is what I have for that page:


Hi,
I needed to download those TypeScript Jasmine-DefinitelyTyped libs as well...
http_github.com_borisyankov_DefinitelyTyped_raw_master_jasmine_jasmine.d.ts
http_github.com_borisyankov_DefinitelyTyped_raw_master_jasmine-matchers_jasmine-matchers.d.ts
http_github.com_borisyankov_DefinitelyTyped_raw_master_karma-jasmine_karma-jasmine.d.ts
...once they're in-scope things might work better?
Tim
Unfortunately that still doesn't fix it.
Correction: This actually does appear to fix it, it is just that the change is less obvious than I thought it would be.
(Edit button appears to be broken.)