Skip to content

"ng test" - no code coverage report if --code-coverage and --reporters options used together #5685

Closed
@alistairmgreen

Description

@alistairmgreen

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.0.0 (Problem was first discovered using version 1.0.0.rc1)
node: 6.9.4
os: win32 x64 (Windows 7 Enterprise)

Repro steps.

  1. ng new coverage-test
  2. npm install --save-dev karma-teamcity-reporter
  3. Add require('karma-teamcity-reporter') to list of plugins in karma.conf.js
  4. ng test --single-run --code-coverage --reporters teamcity - the tests run with TeamCity reporting as expected.
  5. ls coverage - the coverage folder is missing.
  6. Try again with a different reporter: ng test --single-run --code-coverage --reporters progress - same result, tests pass but there is no coverage report.
  7. Try again with no reporter: ng test --single-run --code-coverage - works as expected and generates a coverage report.

The log given by the failure.

No error messages displayed. It just silently fails to produce a coverage report.

Desired functionality.

When running the unit tests on a TeamCity build server, I want to get both a test results summary in TeamCity and a code coverage report.

At present I can only do this by running the tests twice: first with --reporters teamcity to get the results summary, and then again with --code-coverage but no TeamCity reporting.

Mention any other details that might be useful.

I asked a question about this on Stack Overflow but got no replies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions