Running individual tests with JsTestDriverPlugin

I'm using the IntelliJ JSTestDriver plugin, and when I right click on a test file and select Run, it runs all of my tests. My JSTD plugin has a configuration line that looks like

test:
- js-test/*.spec.js

Which is needed for running all of my tests from the command line. But intellij runs all of the tests even when selecting a single file to run.

Is there a way to just run an individual test using JsTestDriver in IntelliJ?

7 comments

No, there isn't at the moment (even in the console).
It's Jasmine JsTestDriver adapter limitation. See the issue: https://github.com/ibolmo/jasmine-jstd-adapter/issues/22 .

0

Sergey,

Thanks. What is still a little confusing through from IntellIJ is that even though you can only run all of the tests, the IntelliJ config still lets you pick an individual file to run and creates a test case with that name. It is a bit misleading because it looks like you are actually running only the single test based on the config name. Maybe the "JavaScript test file" option shouldn't be there for JSTestDriver since it's not possible (and you can just use one of the options based on the JSTestDriver config file).

Jeff



Attachment(s):
jstest-config.png
0

There are other assertion frameworks supported by JsTestDriver, not only Jasmine.
Just to be clear:
1) It's impossible to run an individual Jasmine suite/spec if you run it using JsTestDriver with https://github.com/ibolmo/jasmine-jstd-adapter/ .
2) It's possible to run an individual QUnit test/module if you run it using use JsTestDriver with https://github.com/exnor/QUnit-to-JsTestDriver-adapter .
3) It's possible to run an individual JsTestDriver testCase/testMethod (http://code.google.com/p/js-test-driver/wiki/TestCase) if you run it using JsTestDriver.
So, yes, I agree that "JavaScript test file" doesn't make sense for Jasmine tests.

0

I agree with your assessment. Does this warrant a bug report for IntelliJ?

0

Done, issue IDEA-99340 (there were only Unit Testing subsystems for junit and testng, so I just put it under the junit one - I suspect this will need to be changed).

0

Please sign in to leave a comment.