Cannot Debug Karma/Jasmine test specs from the Context menu
Hi,
I've created a Karma Run/Debug Config and this runs the tests as expected. I can set a break point and if I select the Debug icon instead of the Run icon I can debug tests. This all works fine.
The problem is when I Right-click on a test spec and select Run (or Debug) a new temporary Run/Debug Config is created with the name of the test file, but it's based on the Node test runner rather than Karma, so it fails.
How can Run or Debug an individual test or file?
Thanks,
Please sign in to leave a comment.
It's not currently possible to run individual karma tests, as karma itself doesn't support this feature. Please see https://youtrack.jetbrains.com/issue/WEB-13173, https://github.com/karma-runner/karma/issues/1235
Hi Elena,
Thanks for your reply. I'm confused. You say Karma doesn't support this feature (Running a subset of tests) but the karma-jasmine homepage on Github says "If you want to run only some tests matching a given pattern you can do this in the following way"
So it looks like it should be possible to run a single test from WebStorm by passing the selected file name. The Run/Debug Config for Karma already overrides the Karma config to allow 'browsers' to be set, so why not add another field to the Run/Debug Config to add:
This would allow individual tests to be executed using the existing features of Karma.
Do you think this is something someone could take a look at?
Thanks,
Please read the discussion in https://github.com/karma-runner/karma/issues/1235. Indeed, karma-jasmine adapter does already support `--grep`, but other adapters don't. Moreover, each framework adapter handles arguments in its own non-unified way