intern
intern copied to clipboard
Combine the coverage reporters, add to updated reporter config
The coverage reporters are all just thin wrappers around Istanbul's coverage reporters. Rather than having a bunch of duplicative wrappers, have a single coverage reporter module that accepts options to determine what type of report is to be generated. If multiple types of coverage report are to be generated, multiple reporter instances can be created.
import createCoverageReporter from 'core/lib/reporters/coverage';
// ...
const htmlCov = createCoverageReporter(this, { type: 'html' });
const cobertura = createCoverageReporter(this, { type: 'cobertura' });
Built-in coverage reporters should be configured through a single top level output property:
{
"output": {
// use with default options,
"htmlcoverage": true,
// use with report-specific options
"cobertura": {
"projectRoot": "../../"
}
}
}
See discussion in https://github.com/theintern/intern/issues/1023#issuecomment-582607277.
The config updates are related to #1109.