Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -3,66 +3,66 @@
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
const { ReportBase } = require('istanbul-lib-report');
function LcovOnlyReport(opts) {
this.file = opts.file || 'lcov.info';
this.contentWriter = null;
class LcovOnlyReport extends ReportBase {
constructor(opts) {
super();
this.file = opts.file || 'lcov.info';
this.projectRoot = opts.projectRoot || process.cwd();
this.contentWriter = null;
}
onStart(root, context) {
this.contentWriter = context.writer.writeFile(this.file);
}
onDetail(node) {
const fc = node.getFileCoverage();
const writer = this.contentWriter;
const functions = fc.f;
const functionMap = fc.fnMap;
const lines = fc.getLineCoverage();
const branches = fc.b;
const branchMap = fc.branchMap;
const summary = node.getCoverageSummary();
const path = require('path');
writer.println('TN:'); //no test nam
writer.println('SF:' + path.relative(this.projectRoot, fc.path));
Object.values(functionMap).forEach(meta => {
writer.println('FN:' + [meta.decl.start.line, meta.name].join(','));
});
writer.println('FNF:' + summary.functions.total);
writer.println('FNH:' + summary.functions.covered);
Object.entries(functionMap).forEach(([key, meta]) => {
const stats = functions[key];
writer.println('FNDA:' + [stats, meta.name].join(','));
});
Object.entries(lines).forEach(entry => {
writer.println('DA:' + entry.join(','));
});
writer.println('LF:' + summary.lines.total);
writer.println('LH:' + summary.lines.covered);
Object.entries(branches).forEach(([key, branchArray]) => {
const meta = branchMap[key];
const { line } = meta.loc.start;
branchArray.forEach((b, i) => {
writer.println('BRDA:' + [line, key, i, b].join(','));
});
});
writer.println('BRF:' + summary.branches.total);
writer.println('BRH:' + summary.branches.covered);
writer.println('end_of_record');
}
onEnd() {
this.contentWriter.close();
}
}
LcovOnlyReport.prototype.onStart = function(root, context) {
this.contentWriter = context.writer.writeFile(this.file);
};
LcovOnlyReport.prototype.onDetail = function(node) {
const fc = node.getFileCoverage();
const writer = this.contentWriter;
const functions = fc.f;
const functionMap = fc.fnMap;
const lines = fc.getLineCoverage();
const branches = fc.b;
const branchMap = fc.branchMap;
const summary = node.getCoverageSummary();
writer.println('TN:'); //no test name
writer.println('SF:' + fc.path);
Object.keys(functionMap).forEach(key => {
const meta = functionMap[key];
writer.println('FN:' + [meta.decl.start.line, meta.name].join(','));
});
writer.println('FNF:' + summary.functions.total);
writer.println('FNH:' + summary.functions.covered);
Object.keys(functionMap).forEach(key => {
const stats = functions[key];
const meta = functionMap[key];
writer.println('FNDA:' + [stats, meta.name].join(','));
});
Object.keys(lines).forEach(key => {
const stat = lines[key];
writer.println('DA:' + [key, stat].join(','));
});
writer.println('LF:' + summary.lines.total);
writer.println('LH:' + summary.lines.covered);
Object.keys(branches).forEach(key => {
const branchArray = branches[key];
const meta = branchMap[key];
const line = meta.loc.start.line;
let i = 0;
branchArray.forEach(b => {
writer.println('BRDA:' + [line, key, i, b].join(','));
i += 1;
});
});
writer.println('BRF:' + summary.branches.total);
writer.println('BRH:' + summary.branches.covered);
writer.println('end_of_record');
};
LcovOnlyReport.prototype.onEnd = function() {
this.contentWriter.close();
};
module.exports = LcovOnlyReport;