I am running the following command to unit test and generate code code coverage report.
ng test --code-coverage
It is writing code coverage re
I've just created karma plugin, which adds all the files in the project to coverage statistic - https://github.com/kopach/karma-sabarivka-reporter.
To use it → install npm install --save-dev karma-sabarivka-reporter
And update karma.conf.js
like this:
reporters: [
// ...
'sabarivka'
// ...
],
coverageReporter: {
include: 'src/**/!(*.spec|*.module|environment*).ts', // glob patter which matchs all the files you want to be included into the coverage result
exclude: 'src/main.ts',
// ...
},
This solves issue without any other manipulation. Easy to add to existing projects as well as to new ones.