How to use the Report function from istanbul
Find comprehensive JavaScript istanbul.Report code examples handpicked from public code repositorys.
GitHub: SBoudrias/gulp-istanbul
5 6 7 8 9 10 11 12 13 14
// Make sure istanbul is `require`d after the istanbul-threshold-checker to use the istanbul version // defined in this package.json instead of the one defined in istanbul-threshold-checker. var istanbul = require('istanbul'); var _ = require('lodash'); var applySourceMap = require('vinyl-sourcemaps-apply'); var Report = istanbul.Report; var Collector = istanbul.Collector; var PluginError = require('plugin-error'); var PLUGIN_NAME = 'gulp-istanbul';
87
186
6
+ 9 other calls in file
GitHub: zvelo/karma-coverage
131 132 133 134 135 136 137 138 139 140
dir : outputDir, sourceStore : new BasePathStore({ basePath : basePath }) }); var reporter = istanbul.Report.create(reporterConfig.type || 'html', options); try { reporter.writeReport(collector, true); } catch (e) { log.error(e);
255
0
46
16 17 18 19 20 21 22 23 24 25
collector = new istanbul.Collector(); collector.add(cov); reporters.forEach(function(reporter) { istanbul.Report.create(reporter, reporterOpts).writeReport(collector, true); }); }); };
15
199
11
44 45 46 47 48 49 50 51 52 53
return capsPromise; }, onComplete: function () { browser.driver.executeScript('return __coverage__;').then(function (coverageResults) { collector.add(coverageResults); istanbul.Report .create('lcov', { dir: 'test/coverage/e2e' }) .writeReport(collector, true);
9
6
0
24 25 26 27 28 29 30 31 32 33
} }); Object.defineProperty(exports, 'Report', { enumerable: true, get: function get() { return _istanbul.Report; } }); Object.defineProperty(exports, 'config', { enumerable: true,
1
0
0
GitHub: Grahamcr/devsite1
269 270 271 272 273 274 275 276 277 278
var options = helper.merge({ sourceStore: sourceStore }, config, reporterConfig, { dir: outputDir }) var reporter = istanbul.Report.create(reporterConfig.type || 'html', options) // If reporting to console, skip directory creation var isConsole = reporterConfig.type && reporterConfig.type.match(/^(text|text-summary)$/) var hasNoFile = _.isUndefined(reporterConfig.file)
0
0
1
110 111 112 113 114 115 116 117 118 119
res.statusCode = 404; return res.end('No coverage for file path [' + filePath + ']'); } if(writer) { var report = istanbul.Report.create('html', {writer: writer, dir: rootpath + '/lcov-report'}); writer.writeFile('coverage.json', function (w) { w.write(JSON.stringify(covObj, undefined, 4)); }); report.writeReport(collector, true);
0
0
1
+ 3 other calls in file
istanbul.Collector is the most popular function in istanbul (108 examples)