karma-runner / karma-runner/karma-coverage

multiple patterns matching the same file will break build

Open
#112 3 comments 0 reactions 0 assignees View on GitHub
PR please type: feature
Dominant language
JavaScript
Stars
771
Forks
242
PR merge metrics
No merged PRs in 30d

Description

assuming a preprocessors config like this:

```
preprocessors: {
'app/js/app-module.js': [ 'coverage' ],
'app/js/*.js': [ 'coverage' ]
},
```

`app-module.js` will get instrumented and the output from that will get instrumented again, totally breaking things.

Obviously, the easy answer is "Don't do that", but:
1. I have my reasons for wanting to do it this way.
2. Double processing a file in this way will always be a mistake, so why not just avoid it.
3. Most importantly: the failure message gives no indication of what broke the build. I got `caught TypeError: Cannot read property '2' of undefined`, not super helpful in locating the problem.

I'm happy to work on a PR if you are willing to consider it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.