karma-runner / karma-runner/karma-coverage
Collect coverage from web workers
- Dominant language
- JavaScript
- Stars
- 771
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
We are spawning multiple web workers via webpack's [worker-loader](https://github.com/webpack-contrib/worker-loader). We can see that the code of the web workers is instrumented correctly, and that the coverage information is tracked on `global.__coverage__`.
Note, that the issue seems to be fully decoupled from our use of `worker-loader`.
However, since the `global` is an instance of `DedicatedWorkerScope` in the workers but not `window`, the coverage information that is send to karma in the end is incomplete.
I'm posting this issue to raise awareness for the topic or to be directed to the correct project to do so. So far, I could not find any report of this in `karma-coverage`, `worker-loader`, `babel-plugin-istanbul` or `istanbul` itself.
Contributor guide
Research direction
Start by tracing how coverage from global.__coverage__ is collected and sent to Karma, comparing the DedicatedWorkerScope and window paths. Check the interaction with worker-loader, karma-coverage, babel-plugin-istanbul, and Istanbul. Done means coverage generated inside web workers is included in the final Karma report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100