Javascript - "'karma-coverage-istanbul-reporter' usage has been deprecated since version 11" Message for Angular 11

Starting Angular 11, the karma-coverage-istanbul-reporter has been deprecated. In order to solve this, you can use karma-coverage.

In order to configure this, please do the following:

  1. Install the karma-coverage package - npm install karma karma-coverage

  2. Update the karma.conf.js file and modify the coverageIstanbulReporter to coverageReporter and use the type: 'json' find below an example of such a reporter configuration

    coverageReporter: { dir: 'build/reports/coverage', reporters: [ { type: 'json', subdir: 'report-json' } ] },