istanbuljs / test-exclude

test for inclusion or exclusion of paths using globs
ISC License
8 stars 12 forks source link

The filename field should be compatible? #52

Open luckFine opened 1 year ago

luckFine commented 1 year ago

in the 'index.js' file in the function shouldInstrument

if (
      this.extension &&
      !this.extension.some(ext => filename.endsWith(ext))
  ) {
      return false;
  }

sometimes filename is undefined then report error

image

Can it be changed to !this.extension.some(ext => filename && filename.endsWith(ext))