grunt.registerMultiTask(`makeReport2`, function() { const options = this.options({ reporters: { 'text-summary': {} } }); const collector = new istanbul.Collector(); this.files.forEach((file) => { collector.add(grunt.file.readJSON(file.src[0])); }); Object.keys(options.reporters).forEach((reporterName) => { const reporter = istanbul.Report.create(reporterName, options.reporters[reporterName]); reporter.writeReport(collector, true); }); });
this.files.forEach((file) => { collector.add(grunt.file.readJSON(file.src[0])); });