Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng test --code-coverage produces corrupted coverage reports #12343

Closed
corcorb opened this issue Sep 21, 2018 · 3 comments
Closed

ng test --code-coverage produces corrupted coverage reports #12343

corcorb opened this issue Sep 21, 2018 · 3 comments

Comments

@corcorb
Copy link

corcorb commented Sep 21, 2018

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [x] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

$ node --version
v10.3.0
$ npm --version
6.4.1
$ ng --version
...
Angular CLI: 6.2.3
Node: 10.3.0
OS: darwin x64
Angular: 6.1.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.3
@angular-devkit/build-angular     0.8.3
@angular-devkit/build-optimizer   0.8.3
@angular-devkit/build-webpack     0.8.3
@angular-devkit/core              0.8.3
@angular-devkit/schematics        0.8.3
@angular/cli                      6.2.3
@ngtools/webpack                  6.2.3
@schematics/angular               0.8.3
@schematics/update                0.8.3
rxjs                              6.2.2
typescript                        2.9.2
webpack                           4.19.1

macOS High Sierra (10.13.6)

Repro steps

Create a brand new project, run tests with code coverage:

ng new stock-ng-project
cd stock-ng-project
ng test --watch=false --code-coverage

Open the generated istanbul report:

open coverage/src/app/app.component.ts.html

The log given by the failure

No explicit error.

The report is malformed, including:

  • highlights that don't correspond to tokens
  • Random characters (I, E)
  • Gutter markers that don't correspond to lines with code

Desired functionality

It should be like the version from @angular-devkit/build-angular 0.6.8:

npm install --only=dev @angular-devkit/[email protected]
ng test --watch=false --code-coverage
open coverage/src/app/app.component.ts.html

The report is correctly formatted.

Mention any other details that might be useful

I've tracked this to being introduced by the upgrade of @angular-devkit/build-angular from 0.6.8 to 0.7.0, but that added/updated a lot of webpack and source-map-loader dependencies, and I'm not sure what the root cause is.

@jhage-accesso
Copy link

Related to #11672

@corcorb
Copy link
Author

corcorb commented Sep 21, 2018

Yeah, it's the same issue and should be fixed by #12291

Next time I'll make sure to search closed issues as well as open before filing…

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants