karma-coverage icon indicating copy to clipboard operation
karma-coverage copied to clipboard

Certain globs cause a TypeError

Open seanohue opened this issue 10 years ago • 3 comments

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']

seanohue avatar Jan 07 '16 19:01 seanohue

Yeah, I came across this too. Same exact error for the same exact reason.

worldlee78 avatar Jan 17 '16 19:01 worldlee78

Also having this issue with a slightly more specific path (**/src/app/**/*.js)

PeterCusack avatar Jun 27 '16 21:06 PeterCusack

I'm experiencing the same issue. Anyone knows of a workaround?

It's quite interesting that I experience this only on my local Mac machine, but not on my CI server (Linux).

MatissJanis avatar Mar 21 '17 08:03 MatissJanis