示例#1
0
  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);
    });
  });
示例#2
0
 this.files.forEach((file) => {
   collector.add(grunt.file.readJSON(file.src[0]));
 });