alex-seville / grunt-blanket

grunt task to instrument files for code coverage using Blanket.js
http://blanketjs.org
MIT License
29 stars 6 forks source link

How do I exclude an individual file? #7

Closed davidwilde closed 11 months ago

davidwilde commented 10 years ago

I notice in your README you say that it is possible to exclude individual files in the pattern but I'm being a bit thick and can't seem to do it. Any chance of an example?

I'm trying this:

    blanket:
        options: {}
        files:
            expand: false
            src: ['!dev/app/app.js','/dev/app/']
            dest: './coverage/app/'
alex-seville commented 10 years ago

You would need to do something like:

You can try

blanket:
   options: {
      pattern: '//^dev/app/app.js/'
   },
   files: {
      expand: false,
      src: ['/dev/app/'],
      dest: './coverage/app'
   }
}

Failing that, the code will need to be tweaked to allow data-cover-never to be set in options.

kimmings commented 10 years ago

I'm having the same problem... the above doesn't work for me. (also there's a typo there... you're missing the opening { for the blanket object). In addition, I'm now getting the error: Warning: Instrumentation error, you cannot redefine the coverage variable in even after reverting the changes I've made :(