karma-runner / karma-coverage

A Karma plugin. Generate code coverage.
MIT License
770 stars 247 forks source link

Collect coverage from web workers #317

Open leoselig opened 7 years ago

leoselig commented 7 years ago

We are spawning multiple web workers via webpack's 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.

openmuthu commented 7 years ago

Any updates on this? This is very critical for my project. In my project, all the business logic runs in a worker thread and I need a way to get coverage results for the code running in that thread. Please help.