Running individual jasmine tests

Hi,
   I'm using Intellij 14.0.2, and have configured Kama/Jasmine to run 'karma.conf.js' based tests successfully.  I setup a karma.conf.js that loads all js files in the app, all required js libs, and all test/spec js files, and it successfully runs all of the jasmine tests when I run it under Intellij using a Karma test configuration.

   However, I'd like to also by able to manually run individual jasmine tests directly from intellij.  When I try to run an individual jasmine test (either by running an individual test from the editor, or clicking on the desired test in the 'test tree' after running the above karma suite containing all tests), I get the below in the console:

"C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.0.2\bin\runnerw.exe" C:\apps\nodejs\node.exe UtilsSpec.js

c:\sand\dashboard-uber-jfx2\dashboard\spa\src\test\js\cv\utils\UtilsSpec.js:5

describe("UtilsSpec Suite", function () {

^

ReferenceError: describe is not defined

    at Object.<anonymous> (c:\sand\dashboard-uber-jfx2\dashboard\spa\src\test\js\cv\utils\UtilsSpec.js:5:1)

    at Module._compile (module.js:456:26)

    at Object.Module._extensions..js (module.js:474:10)

    at Module.load (module.js:356:32)

    at Function.Module._load (module.js:312:12)

    at Function.Module.runMain (module.js:497:10)

    at startup (node.js:119:16)

    at node.js:906:3


Process finished with exit code 8

I believe it is trying to use a 'Node.js' test runner to run the individual test instead of the configured Karma test runner.

Note that I've configured Settings->Language and Frameworks->Javascript->Libraries to have both 'jasmine-DefinitelyTyped' and 'jasmine-core/lib/jasmine.js as Global libraries, and am still getting the above.  I'm using Jasmine 2.0 and Typescript 1.3 if that matters.

Questions:
1. Why is it trying to run the jasmine test using the Node.js test runner?
2. Can you configure karma to run individual tests (besides creating a custom karma.confg.js for every test)?  Or do I need to setup up something else to run individual tests?
3. How do I get the test runner to know about the other files (files under test, and libraries just as jasmine, jquery, ...) that need to be loaded as part of the test context before the individual test can be run?


I'm so close (can run the entire suite of jasmine tests using Karma) - just need to be able to run/debug individual jasmine tests...

Thanks,
Brad

2 comments
Comment actions Permalink

+1 !!
Please someone gives an answer :|

1
Comment actions Permalink

I would like to raise the topic UP. 

My scenario is very similar and quite simple:

(1) I have single jasmine test file

(2) and I'd like just execute it by simple way like 'choose test file -> right click -> run'

Then I would expect that _underneath_ separate nodejs jasmine run configuration will be created.

Could you please answer?

many thanks!

 

Rafał

 

1

Please sign in to leave a comment.