Search code examples
jasminewebstorm

Basic Jasmine test setup with Webstorm


I've tried following the documentation on this. It helped me setup a JsTestDriver environment using something like-but-not-quite JUnit as the test language.

https://code.google.com/p/js-test-driver/wiki/GettingStarted

I would like to replicate this setup in Webstorm - creating the remote server, capture browsers as "slaves," output results in Webstorm, etc - but use Jasmine in lieu of the JsTestDriver language.

Can this be done? If so, can someone point me in the right direction?

Thanks in advance.


Solution

  • I found what I was looking for.

    http://devnet.jetbrains.com/thread/435906

    This link provides details on how to set up Jasmine in Webstorm via JsTestDriver. It also includes a sample Jasmine/Webstorm project for download. I was missing lines in my .jstd file that load Jasmine.js and JasmineAdapter.js (must be referenced first). With those files included, the .jstd file runs the unit test environment. Very nice.

    Here is the entire config (jstd) file contents.

    load:
      - jasmine-lib/jasmine.js
      - jasmine-lib/JasmineAdapter.js
      - src/Greeter.js
    
    test:
      - test/GreeterTest.js