Project-wide code coverage with Angular / Karma ?

We can run project-wide tests with Karma using a Karma-specific run configuration, and we can get specific test groups code coverage with "Run '...' with Code Coverage" (as described in the documentation), but is there a way to get project-wide Karma code coverage?

0
6 comments

Hello,

Code coverage in Rider is based on the dotCover plugin. dotCover is a coverage tool for .NET family: C#, F#, and VB.NET.

For the coverage of JavaScript, please refer to WebStorm.

Have a nice day!

0

So the current karma coverage integration with Rider is not official support?

We're certainly not going to use two IDEs for our project. Sounds like the suggested solution is just using karma directly and not using Rider for coverage of JavaScript projects.

0

Karma coverage is officially supported in Rider  (as it's written in the documentation)

Please could you clarify what you mean by the project-wide coverage? If you have a project-wide set of tests (usually all tests included in your karma config), can't you run them with coverage?

0

Thanks Elena,

yes that's my question, I don't see any documented or visible way to run with coverage. We can run a run-configuration with Karma, which targets "All tests", but I see no mechanism to have this open the same coverage UI that the inline "Run '...' with Code Coverage" opens (or used to open at least, after the latest update we never get any coverage reported).

My workaround currently is just viewing the coverage HTML generated by the karma-coverage package, but we hoped to be able to use the Rider coverage UI that we traditionally saw with "Run '...' with Code Coverage".

 

Edit to clarify: notice that the documentation page explains how to (1) run all tests, (2) run specific tests, and (3) run specific tests with coverage.... but makes no mention of (4) run all tests with coverage. (4) is what I cannot figure out how to do.

0

You can use Run with coverage from the karma.config.js right-click menu:

Does it work for you?

There is no main toolbar button for this action, https://youtrack.jetbrains.com/issue/RIDER-48737

0

Oh that's exactly what I need! Thanks Elena! I hadn't even thought to look there.

1

Please sign in to leave a comment.