grunt-istanbul
grunt-istanbul copied to clipboard
plugin config is not namespaced
Hi, I'm currently using load-grunt-config in order to load grunt task files, each of which contains relevant config for that task. Most plugins will namespace their config. So jsonlint
would need config like
jsonlint: {
src: [ 'some/valid.json' ]
}
And instead, I have jsonlint.js
which is loaded and the config is associated with the jsonlint
key.
'use strict';
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-jsonlint');
return {
src: [
'*.json',
'src/**/*.json'
]
};
};
However, istanbul
does not namespace these, so I can't set up my makeReport
task in the same way. Have you considered namespacing some or all of this plugin config? Like:
istanbul: {
makeReport: {
src: 'test/coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'test/coverage/reports',
print: 'detail'
}
}
}
It's worth mentioning that I can just name my file makeReport.js
to get around this in my case, though I did find it curious that the config wasn't named similarly to other plugins.
Hi @yomed, did you ever work out a fix for this? My build is failing at Warning: Task "istanbul:instrument" not found. Use --force to continue.
I don't want to add the tasks into my Gruntfile and, even if I create separate JS files for the tasks, e.g. grunt/mochaTest.js, it still can't find some tasks. Seems to work for instrument
and makeReport
but not mochaTest
or storeCoverage
..