Checking your testing code coverage in Angular Project

Anil Kumar
Apr 24, 2023

Step 1 . Check your karma.conf.js file it should having coverage directory mentioned

coverageIstanbulReporter: {

dir: require(‘path’).join(__dirname, ‘./coverage/<your project name>’),

reports: [‘html’, ‘lcovonly’, ‘text-summary’],

fixWebpackSourcePaths: true

},

Step 2 : run : ng test — code-coverage

It will create a folder name <your project name> inside Project folder Coverage folder.

Step 3. Serve that folder with any http server on any port.

Example server using : node server , python server

I am serving using chrome app: web server

then giving port and open it. now in browser see progress.

--

--