How to use the istanbul-lib-coverage.createFileCoverage function in istanbul-lib-coverage

To help you get started, we’ve selected a few istanbul-lib-coverage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-coverage / istanbul-lib-coverage-tests.ts View on Github external
summary1.branches;
summary1.lines;
summary1.functions;
summary1.statements;
const summary2 = createCoverageSummary(summary1);

const map1 = createCoverageMap(coverageMapData);
map1.data;
const map2 = createCoverageMap(map1);
map2.data;

const fileCoverage1 = createFileCoverage('path/to/foo');
fileCoverage1.data;
const fileCoverage2 = createFileCoverage(fileCoverage1.data);
fileCoverage2.data;
const fileCoverage3 = createFileCoverage(fileCoverageData);
fileCoverage3.data;

// CoverageSummary methods and properties
summary1.isEmpty();
summary1.toJSON();
summary1.merge(summary2);

// CoverageMap methods and properties
map1.addFileCoverage('foo.js');
map1.addFileCoverage(fileCoverageData);
map1.files()[0];
map1.fileCoverageFor('foo').path;
map1.filter(name => false);
map1.merge(map2);
map1.merge(coverageMapData);
github DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-coverage / istanbul-lib-coverage-tests.ts View on Github external
const summary1 = createCoverageSummary(summaryData);
summary1.data;
summary1.branches;
summary1.lines;
summary1.functions;
summary1.statements;
const summary2 = createCoverageSummary(summary1);

const map1 = createCoverageMap(coverageMapData);
map1.data;
const map2 = createCoverageMap(map1);
map2.data;

const fileCoverage1 = createFileCoverage('path/to/foo');
fileCoverage1.data;
const fileCoverage2 = createFileCoverage(fileCoverage1.data);
fileCoverage2.data;
const fileCoverage3 = createFileCoverage(fileCoverageData);
fileCoverage3.data;

// CoverageSummary methods and properties
summary1.isEmpty();
summary1.toJSON();
summary1.merge(summary2);

// CoverageMap methods and properties
map1.addFileCoverage('foo.js');
map1.addFileCoverage(fileCoverageData);
map1.files()[0];
map1.fileCoverageFor('foo').path;
map1.filter(name => false);
map1.merge(map2);
github DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-coverage / istanbul-lib-coverage-tests.ts View on Github external
};

const summary1 = createCoverageSummary(summaryData);
summary1.data;
summary1.branches;
summary1.lines;
summary1.functions;
summary1.statements;
const summary2 = createCoverageSummary(summary1);

const map1 = createCoverageMap(coverageMapData);
map1.data;
const map2 = createCoverageMap(map1);
map2.data;

const fileCoverage1 = createFileCoverage('path/to/foo');
fileCoverage1.data;
const fileCoverage2 = createFileCoverage(fileCoverage1.data);
fileCoverage2.data;
const fileCoverage3 = createFileCoverage(fileCoverageData);
fileCoverage3.data;

// CoverageSummary methods and properties
summary1.isEmpty();
summary1.toJSON();
summary1.merge(summary2);

// CoverageMap methods and properties
map1.addFileCoverage('foo.js');
map1.addFileCoverage(fileCoverageData);
map1.files()[0];
map1.fileCoverageFor('foo').path;