How to use the Collector function from istanbul
Find comprehensive JavaScript istanbul.Collector code examples handpicked from public code repositorys.
GitHub: SBoudrias/gulp-istanbul
6 7 8 9 10 11 12 13 14 15
// 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'; var COVERAGE_VARIABLE = '$$cov_' + new Date().getTime() + '$$';
87
186
6
+ 9 other calls in file
GitHub: webex/webex-js-sdk
36 37 38 39 40 41 42 43 44 45
await fs.writeFile(intermediatePath, JSON.stringify(coverage, null, 2)); debug(`stored intermediate coverage for ${packageName}`); } async function combine(packageName) { const collector = new Collector(); const pattern = `reports/coverage/intermediate/${packageName}{.json,/**/*.json}`; const files = await g(pattern); for (const f of files) {
304
151
43
+ 11 other calls in file
GitHub: 12spokes/rtd
158 159 160 161 162 163 164 165 166 167
return ret; } core.render = function (filePath, res, prefix) { prefix = '/coverage'; var collector = new istanbul.Collector(), treeSummary, pathMap, linkMapper, outputNode,
41
0
14
92 93 94 95 96 97 98 99 100
collectors = Object.create(null); // TODO(vojta): remove once we don't care about Karma 0.10 if (browsers) { browsers.forEach(function(browser) { collectors[browser.id] = new istanbul.Collector(); }); } };
24
136
13
+ 3 other calls in file
104 105 106 107 108 109 110 111 112 113
}; var collectReports = function collectReports(opts) { var reportFile = path.resolve(reportingDir, options.coverage.reportFile), // http://gotwarlost.github.io/istanbul/public/apidocs/classes/Collector.html collector = new istanbul.Collector(), cov = global[coverageVar]; if (options.coverage.includeAllSources) { includeAllSources(cov, opts);
23
28
9
+ 3 other calls in file
11 12 13 14 15 16 17 18 19 20
if (options.reportDir) reporterOpts.dir = options.reportDir; if (process.env.ISTANBUL_REPORT_DIR) reporterOpts.dir = process.env.ISTANBUL_REPORT_DIR; runner.on('end', function(){ var cov = global.__coverage__ || {}, collector = new istanbul.Collector(); collector.add(cov); reporters.forEach(function(reporter) {
15
199
11
35 36 37 38 39 40 41 42 43 44 45 46 47
); const coverage = loadCoverage(wctCoverage); const collector = remap(coverage); const newCollector = new Collector(); /** * Manually filter some stuff out! */
5
22
0
12 13 14 15 16 17 18 19 20 21
} }); Object.defineProperty(exports, 'Collector', { enumerable: true, get: function get() { return _istanbul.Collector; } }); Object.defineProperty(exports, 'hook', { enumerable: true,
1
0
0
GitHub: Grahamcr/devsite1
209 210 211 212 213 214 215 216 217 218
browsers.forEach(this.onBrowserStart.bind(this)) } } this.onBrowserStart = function (browser) { collectors[browser.id] = new istanbul.Collector() if (!includeAllSources) return collectors[browser.id].add(coverageMap.get())
0
0
1
GitHub: pushrocks/tapbuffer
9 10 11 12 13 14 15 16 17 18
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)
0
0
2
GitHub: myndzi/test-runner
16 17 18 19 20 21 22 23 24 25
module.exports = function (sourceDirs, opts, runner, _injected) { _injected = _injected || { }; var Reporter = _injected.Reporter || istanbul.Reporter, Collector = _injected.Collector || istanbul.Collector; var matchFn = (function () { var REs = sourceDirs.map(function (sourceDir) { return {
0
0
16
+ 7 other calls in file
istanbul.Collector is the most popular function in istanbul (108 examples)