intern icon indicating copy to clipboard operation
intern copied to clipboard

Combine the coverage reporters, add to updated reporter config

Open jason0x43 opened this issue 5 years ago • 1 comments

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.

jason0x43 avatar Apr 14 '20 13:04 jason0x43

The config updates are related to #1109.

jason0x43 avatar Apr 14 '20 14:04 jason0x43