karma-runner / karma-runner/karma-coverage

Certain globs cause a TypeError

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

Description

It seems that using a globbing pattern such as `**/**/*.js` will cause the following error when running karma-coverage:

`PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
TypeError: 'undefined' is not an object (evaluating '__cov_hmKLkt0YIrHx8V6$TQ0_kg.s['2']')`

In the karma.conf preprocessor object, the glob that caused this error was set up like:
`'app/!(vendor)**/**/!(*.spec).js': ['coverage']`

Changing the second *\* to a specific directory "fixed" the error:
`'app/!(vendor)**/specific-dirname/!(*.spec).js': ['coverage']`

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the glob patterns shown in the issue's karma.conf preprocessor configuration, then inspect how karma-coverage handles those patterns before PhantomJS reports the TypeError. Done means the glob completes without the undefined coverage error and coverage is generated for the matching files.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.