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: Source maps don't match when using --code-coverage #19084

Closed
1 of 15 tasks
daelmaak opened this issue Oct 15, 2020 · 4 comments
Closed
1 of 15 tasks

ng test: Source maps don't match when using --code-coverage #19084

daelmaak opened this issue Oct 15, 2020 · 4 comments

Comments

@daelmaak
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Not sure.

Description

When running ng test --code-coverage and then debugging in chrome, the source maps don't match the actual code. On picture, the execution should have stopped at debugger;, which it seemingly doesn't:

Screenshot from 2020-10-15 10-46-33

🔬 Minimal Reproduction

Using ng cli 10.1.5

  1. ng new
  2. in the newly created project, run ng test --code-coverage
  3. open source file of app.component.ts in the browser controlled by karma
  4. place some breakpoints and check whether it is was placed on correct line (which it won't)

🔥 Exception or Error

none

🌍 Your Environment


Angular CLI: 10.1.5
Node: 12.11.0
OS: linux x64

Angular: 10.1.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.4
@angular-devkit/build-angular   0.1001.5
@angular-devkit/core            10.1.5
@angular-devkit/schematics      10.1.5
@angular/cdk                    10.2.4
@angular/flex-layout            10.0.0-beta.32
@angular/material               10.2.4
@nguniversal/builders           10.1.0
@nguniversal/common             10.1.0
@nguniversal/express-engine     10.1.0
@schematics/angular             10.1.5
@schematics/update              0.1001.5
rxjs                            6.6.3
typescript                      3.9.7

Anything else relevant?
not to my knowledge

@alan-agius4
Copy link
Collaborator

Hi @daelmaak,

Had a quick look at this and from my initial investigation this looks more of an upstream issue. Likely, it's in https://github.com/JS-DevTools/coverage-istanbul-loader or https://github.com/istanbuljs/istanbuljs

@restjohn
Copy link

This appears to be the same as #7117. The discussion there indicates the issue is with webpack-contrib/istanbul-instrumenter-loader. Regardless, this makes debugging Angular tests, not even live debugging but just referencing line numbers in test output, impossible when code coverage is enabled, which Angular does by default. Caveat: I'm currently still using Angular 8, though apparently the issue is still outstanding.

@alan-agius4
Copy link
Collaborator

I'm sorry, but this issue is not caused by Angular CLI. Please contact the author(s) of the @jsdevtools/coverage-istanbul-loader project or file an issue on their issue tracker.

@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 Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants