I am running the following command to unit test and generate code code coverage report.
ng test --code-coverage
It is working fine and writ
With the latest CLI, inside angular.json
"test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "./karma.conf.js", "codeCoverageExclude": ["src/testing/**/*"],