Angular Cli Exclude Files/directory For `ng Test --code-coverage`
Answer : 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/**/*"], Updated September 2019 With Angular CLI 6, angular-cli.json has been renamed to angular.json which contains the configuration. In angular.json , codeCoverage expects a boolean value, which sets whether code-coverage should be done with every test run or not. To exclude files from code coverage, there is a property codeCoverageExclude which accepts an array of files to be excluded from code coverage. angular.json "test": { "codeCoverageExclude": ...