Skip to content

code coverage report for a library should include only library specific files #11331

Closed
@vimalraj-a

Description

@vimalraj-a

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Area

- [x] devkit
- [ ] schematics

Versions

Node: v8.11.1
Npm: 6.1.0
Windows 10

Repro steps

  1. create library (name = foo)
  2. create shared library (name = shared-util)
  3. Library foo depends on library shared-utils
  4. Generate coverage report for library foo.

Coverage report contains some files from shared utils with wrong coverage percent because it didn't pick the shared-utils's spec file but included in instrumentation.

The log given by the failure

NA

Desired functionality

Need option to include only project specific files for code coverage report. Though we have option for excluding folder or files from coverage report, not helping in bigger mono repositories.
Every time I have to update angular.json to exclude every internal library reference I have.

Mention any other details that might be useful

 "root": "libs/admin/acl/feature-acl",
 "sourceRoot": "libs/admin/acl/feature-acl/src",
 "projectType": "library",
 "architect": {
     "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "libs/admin/acl/feature-acl/src/test.ts",
            "tsConfig": "libs/admin/acl/feature-acl/src/tsconfig.spec.json",
            "karmaConfig": "libs/admin/acl/feature-acl/karma.conf.js",
            codeCoverageInclude: ["libs/admin/acl/feature-acl"] 
          }
      }
 }

codeCoverageInclude-> will help a lot or allow us use ! in codeCoverageExclude

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions