Open
Description
What problem does this feature solve?
Coverage reporting for unit tests
What does the proposed API look like?
Is there a way to enable coverage for the mocha plugin? When set up manually on another project, you add the istanbul coverage instrumenter as a webpack loader like this:
webpackConfig.module.rules.unshift({
test: /\.(js)$/,
loader: `istanbul-instrumenter-loader`,
options: {esModules:true},
exclude: [
path.resolve(`node_modules`),
// Exclude tests from test coverage
path.resolve(`src/tests`),
/\.(spec|e2e|tests)\.ts$/,
]
})
And then you need to add lcov
as a reporter.
This explanation is pretty comprehensive:
https://github.com/zinserjan/mocha-webpack/blob/master/docs/guides/code-coverage.md