Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
statements: 0,
lines: 0,
branches: 0,
functions: 0,
excludes: [] // Currently list of files (root + path). For future, extend to patterns.
},
each: {
statements: 0,
lines: 0,
branches: 0,
functions: 0,
excludes: []
}
}
};
ret.reporting.watermarks = libReport.getDefaultWatermarks();
ret.reporting['report-config'] = {};
return ret;
}
// Instance variables
// ------------------
this.adapters = []
// Options
// -------
var config = rootConfig.coverageReporter || {}
var basePath = rootConfig.basePath
var reporters = config.reporters
var sourceMapStore = globalSourceMapStore.get(basePath)
var includeAllSources = config.includeAllSources === true
if (config.watermarks) {
config.watermarks = helper.merge({}, istanbulLibReport.getDefaultWatermarks(), config.watermarks)
}
if (!helper.isDefined(reporters)) {
reporters = [config]
}
var coverageMaps
function normalize (key) {
// Exclude keys will always be relative, but covObj keys can be absolute or relative
var excludeKey = isAbsolute(key) ? path.relative(basePath, key) : key
// Also normalize for files that start with `./`, etc.
excludeKey = path.normalize(excludeKey)
return excludeKey
}
statements: 0,
lines: 0,
branches: 0,
functions: 0,
excludes: [] // Currently list of files (root + path). For future, extend to patterns.
},
each: {
statements: 0,
lines: 0,
branches: 0,
functions: 0,
excludes: []
}
}
};
ret.reporting.watermarks = libReport.getDefaultWatermarks();
ret.reporting['report-config'] = {};
return ret;
}
ReportingOptions.prototype.watermarks = function() {
const v = this.config.watermarks;
const defs = libReport.getDefaultWatermarks();
const ret = {};
Object.keys(defs).forEach(k => {
const mark = v[k];
//it will already be a non-zero length array because of the way the merge works
const message = isInvalidMark(mark, k);
if (message) {
console.error(message);
ret[k] = defs[k];
} else {
ret[k] = mark;
}
});
return ret;
};
ReportingOptions.prototype.watermarks = function() {
const v = this.config.watermarks;
const defs = libReport.getDefaultWatermarks();
const ret = {};
Object.keys(defs).forEach(k => {
const mark = v[k];
//it will already be a non-zero length array because of the way the merge works
const message = isInvalidMark(mark, k);
if (message) {
console.error(message);
ret[k] = defs[k];
} else {
ret[k] = mark;
}
});
return ret;
};
async reportCoverage(coverageReport, environment) {
this.coverageMap.merge(coverageReport);
const coverageMap = createCoverageMap(coverageReport);
const remappedCoverageMap = await createSourceMapStore().transformCoverage(coverageMap);
const reportDir = this.coverageDir.directory(environment);
const context = createContext({
dir: reportDir.path,
watermarks: getDefaultWatermarks(),
coverageMap: remappedCoverageMap,
});
createReporter('html').execute(context);
createReporter('lcovonly').execute(context);
}
}