Search code examples
gruntjsphantomjsqunitgrunt-contrib-qunit

Grunt Qunit exclude file(s)


I have configured the qunit task like this:

//For testing
qunit: {
    all: ['Test/**/*.html']
},

Is it possible if I want to exclude one (or two) particular html file?. I want to do something like this:

//For testing
qunit: {
    all: ['Test/**/*.html'],
    options: {
         exclude: ['Test/**/ToBeExcluded.html']
    }
},

I read documentation of qunit, but didn't see something like this. Is there a way? Thanks


Solution

  • The QUnit grunt task uses the same globbing pattern matcher as most other tasks. Therefore, you can simply add a negated pattern to your target array of URLs:

    qunit: {
        all: ['Test/**/*.html', '!Test/**/ToBeExcluded.html']
    }