If you developed your project using Angular -CLI, you can simply run
ng test --code-coverage
with the following (or similar) configuration in the karma.conf.js file
coverageIstanbulReporter: { reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true, thresholds: { global: { // thresholds for all files statements: 0, lines: 0, branches: 0, functions: 0 }, each: { // thresholds per file statements: 0, lines: 0, branches: 0, functions: 0 } } },
honestly, if not, the Karma Istanbul maintenance tool is excellent and relatively easy to install.
source share