Search code examples
unit-testingconfigurationmocha.jskarma-runnerwebstorm

How do I control autogenerated test targets in WebStorm?


I've just upgraded to WebStorm 2017.1 and suddenly I have these very nice "run this test" buttons in my test files:

Run one test button

However, any time I click one of these buttons, WebStorm is autogenerating a Mocha test target:

autogenerated 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?


Solution

  • The official answer from JetBrains as of 2017-03-23 is that running individual tests with Karma is not currently supported. This feature request (about 2.5 years old now) is being tracked as WEB-13173.