How to use the Reporter function from istanbul

Find comprehensive JavaScript istanbul.Reporter code examples handpicked from public code repositorys.

264
265
266
267
268
269
270
271
272
273
var options = this.coverage;
if (!options) {
  return;
}

var reporter = new istanbul.Reporter(false, options.dir);
var collector = new istanbul.Collector();
var formats = options.reporters ? _.toArray(options.reporters) : ['text'];

// If we are reporting text to the command line we need to add a newline
fork icon27
star icon120
watch icon0

+ 2 other calls in file

36
37
38
39
40
41
42
43
44
45
  }
});
Object.defineProperty(exports, 'Reporter', {
  enumerable: true,
  get: function get() {
    return _istanbul.Reporter;
  }
});
Object.defineProperty(exports, 'utils', {
  enumerable: true,
fork icon1
star icon0
watch icon0

47
48
49
50
51
52
53
54
55
56
  open("http://0.0.0.0:3000", "firefox");
}

function generateCoverageReport(json) {
  var collector = new istanbul.Collector(),
    reporter = new istanbul.Reporter(),
    sync = false;
    collector.add(json);
    reporter.add('text');
    reporter.addAll([ 'lcov', 'clover' ]);
fork icon0
star icon3
watch icon4

3
4
5
6
7
8
9
10
11
12
var rawJsonReporter = require('istanbul-reporter-raw-json');
istanbul.Report.register(rawJsonReporter);

function report(objects, reports, reportDir) {
  var collector = new istanbul.Collector();
  var reporter = new istanbul.Reporter(null, reportDir);

  objects.forEach(function(obj) {
    collector.add(obj);
  });
fork icon10
star icon0
watch icon2

0
1
2
3
4
5
6
7
8
9
'use strict';

var istanbul = require('istanbul');

var collector = new istanbul.Collector();
var reporter = new istanbul.Reporter();

function report(objects, reports) {
  objects.forEach(function(obj) {
    collector.add(obj);
fork icon10
star icon0
watch icon1

10
11
12
13
14
15
16
17
18
19
let localInstrumenter = new istanbul.Instrumenter({
  coverageVariable: '__coverage__',
  instrumenter: istanbul.Instrumenter
})
let localCollector = new istanbul.Collector()
let localReporter = new istanbul.Reporter(null, `coverage/test-${testNumber}`)

// handle testableFiles
let testableFilesToInject = JSON.parse(process.env.TESTABLEFILES_JSON)
let fileArray: smartinject.fileObject[] = []
fork icon0
star icon0
watch icon2

40
41
42
43
44
45
46
47
48
49
var excludes = config.instrumentation.excludes(true);

var reportingDir = path.resolve(config.reporting.dir());
mkdirp.sync(reportingDir); //ensure we fail early if we cannot do this

var reporter = new istanbul.Reporter(config);
reporter.dir = reportingDir;

var reports = config.reporting.reports();
var index;
fork icon0
star icon0
watch icon2

+ 7 other calls in file