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

Grunt seems to fail when loading the grunt-blanket task #1

Closed derekcicerone-zz closed 11 years ago

derekcicerone-zz commented 11 years ago

I see a bunch of errors like this: Loading "compress.js" tasks...ERROR

Error: Bad file instrument indicator. Must be a string, regex, function, or array.

It seems like the grunt-blanket plugin might be trying to instrument my grunt tasks.

alex-seville commented 11 years ago

Can you post your grunt config?

i.e.: blanket: { instrument: { options: { debug: true }, files: { 'cov/': ['tasks/*.js'], }, } },

derekcicerone-zz commented 11 years ago

That's the weird part - I actually haven't put in the config part yet. Just including the load call is enough to reproduce: grunt.loadNpmTasks("grunt-blanket");

There seems to be an error for each task Grunt is attempting to load: $ grunt build Loading "coffeelint.js" tasks...ERROR

Error: Bad file instrument indicator. Must be a string, regex, function, or array. Loading "clean.js" tasks...ERROR Error: Bad file instrument indicator. Must be a string, regex, function, or array. Loading "coffee.js" tasks...ERROR Error: Bad file instrument indicator. Must be a string, regex, function, or array. Loading "copy.js" tasks...ERROR Error: Bad file instrument indicator. Must be a string, regex, function, or array. Loading "handlebars.js" tasks...ERROR Error: Bad file instrument indicator. Must be a string, regex, function, or array. Loading "htmlmin.js" tasks...ERROR Error: Bad file instrument indicator. Must be a string, regex, function, or array.

alex-seville commented 11 years ago

Figured it out. My require("blanket") statement was too early. I'm publishing to npm right now and pushing to github.

alex-seville commented 11 years ago

Done. Let me know if that works (locally I don't get any grunt errors, but I didn't do a full instrumentation test to see if there aren't any other issues).

alex-seville commented 11 years ago

I tested again and full instrumentation work for me.

derekcicerone-zz commented 11 years ago

Cool, thanks, that was super fast! I'll check it out first thing tomorrow.

Derek Sent from my iPad

On Mar 12, 2013, at 10:30 PM, Alex Seville notifications@github.com wrote:

I tested again and full instrumentation work for me.

— Reply to this email directly or view it on GitHub.

derekcicerone-zz commented 11 years ago

Works great - thanks for the quick fix!