modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.23k stars 297 forks source link

CoverageConfig "report" option apparently not implemented #2828

Open miyasudokoro opened 1 month ago

miyasudokoro commented 1 month ago

I am updating the documentation for CoverageConfig, and I realized the "report" option (boolean) does not seem to do anything. Setting coverageConfig.report to false did not stop any reports from being written.

The only place I can find it in the source code is here, in getCodeCoverage.ts:

  if (!watch && coverageConfig.report && coverageConfig.reporters?.includes('lcov')) {
    entries.push(
      `View full coverage report at ${underline(
        path.join(coverageConfig.reportDir ?? '', 'lcov-report', 'index.html'),
      )}`,
    );
  }

If someone has set "coverage" to true, then it would be very strange for them not to want any reports for that coverage. Would it make sense to remove the "report" option from CoverageConfig? Or should someone implement it, such that setting "report" to false would prevent reports from being generated?