How to prefer Karma when autogenerating unit test targets?
I've just upgraded to WebStorm 2017.1 and suddenly I have these very nice "run this test" buttons in my test files:
However, any time I click one of these buttons, WebStorm is autogenerating a Mocha test target:
The problem is, I'm using Karma for unit tests on this project. I've already followed the instructions from the WebStorm documentation on setting up Karma. I've set up Karma defaults and manually created a Karma target (and removed all Mocha targets, as far as I know), but the IDE still tries to autogenerate a Mocha target any time I ask it to run tests.
How do I tell WebStorm that it should use Karma to run tests, rather than Mocha?
(Cross-posted from StackOverflow)
Please sign in to leave a comment.


Running individual karma tests is not yet supported, please follow https://youtrack.jetbrains.com/issue/WEB-13173 for updates.
WebStorm tries to run your tests with other available runners instead, this usability issue is tracked as https://youtrack.jetbrains.com/issue/WEB-25932
Hi Elena, thanks for the quick response! I'll keep an eye on those issues.
I have a follow-up question. In our project (code-dot-org) we've got a grunt task set up that does allow us to run a single file or test via Karma, by generating an "entry point" bundle for only the needed test file. Is there any way to configure the run icon in the gutter to run a grunt task instead? What I'd really like is a setting to make those arrows run a task I've pre-configured (say, at a project level) and provide the test file path and test name (or group name) as environment variables that can be used in the "Arguments" parameter to the pre-configured task. Is that possible at this time?
No, this can't be configured