pocesar / grunt-mocha-istanbul

Almost config-free Istanbul code coverage reporter for Mocha usage in Grunt
MIT License
75 stars 23 forks source link

options.excludes does not seem to be working. #73

Open DrMiaow opened 6 years ago

DrMiaow commented 6 years ago

image

image

pocesar commented 6 years ago

does it make any difference if you start the excludes like **/webpack/bootstrap/* ? bootstrap is a folder I assume

DrMiaow commented 6 years ago

Tried it, it makes no difference.

pocesar commented 6 years ago

some things to try:

I'm guessing webpack is a "virtual" module that doesn't actually exist as a file (since there's no extension in there), but exists as a module inside the code, either as a non static import, or lazy loaded

DrMiaow commented 6 years ago

options.includes seems to work (excluding the files) but then it breaks remap-istanbul which is unable to find the source-map.

I'm transpiling into ./dist , which is also where the sourcemap file is located.

A solution I have found is to use a feature in remap-istanbul which has an option filter out files from the remapping and final report.

exclude: /webpack\/(bootstrap|universalModuleDefinition)/,

artbindu commented 1 year ago

Try to use the file extension name under excludes Istanbul Options. It will work.

As example:

 excludes: [
    '*.test.ts', '*.test.js'
 ],

or

 excludes: [
    '*.test.*'
 ],

I tried to use the directory path then it's not working. But it should work. I also used the istanbuljs/nyc and see their directory path is working.