angular cli exclude files/directory for `ng test --code-coverage`

后端 未结 2 2006
误落风尘
误落风尘 2020-12-09 08:32

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

2条回答
  •  旧巷少年郎
    2020-12-09 08:50

    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/**/*"],
    

提交回复
热议问题