karma-runner / karma-runner/karma-coverage

coverage only generated for the last browser (when having multiple browsers)

Open
#223 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
771
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Assuming you have the following configuration:

``` javascript
coverageReporter: {
dir: "build/coverage/",
reporters: [{
type: "html",
subdir: "report-html"
}, {
type: "lcov",
subdir: "report-lcov"
}, {
type: "text"
}]
}
```

and you are having multiple browsers configured. Then what you get is a folder `build/coverage/report-html/` with e.g.
![directly](https://cloud.githubusercontent.com/assets/8310677/14206169/92809840-f811-11e5-9411-793fa4b89702.png)

So you are only able to view the coverage for the last runned browser. However, when removing the `subdir` property from the above snippet, a folder structure like the following will be generated under `build/coverage/`, to view coverage for all browsers.
![subdir](https://cloud.githubusercontent.com/assets/8310677/14206184/b56ac97a-f811-11e5-8803-3e0281315c1c.png)

Unfortunately I can't live without using `subdir` as this means that all reports will be written to the same directory.

@dignifiedquire is this a known behavior?

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported configuration with multiple browsers and the HTML, lcov, and text coverage reporters, comparing runs with and without subdir. Done means coverage output remains available for every browser while preserving separate report directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.