constructor coverage for angular is not correct anymore
See original GitHub issueCurrent Behavior
If you have an angular lib/app with an injection in the constructor then jest reports it as a not covered branch
Expected Behavior
This is a regression I remember it working around 1-2 weeks ago (was 14.6.5 I think).
Steps to Reproduce
Reproduction: https://github.com/nrwl/nx-examples/pull/229
- run
yarn nx products:test
- observe the coverage info
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Angular 4 unittest coverage not 100% due to contructor
I noticed that my coverage from my Angular 4 project is not 100% due to problems with the constructor. I'm using the default...
Read more >Component testing scenarios - Angular
In a spec with multiple expectations, it can help clarify what went wrong and which expectation failed. The remaining tests confirm the logic...
Read more >Unit Tests, How to Write Testable Code, and Why It Matters
We will see that writing unit tests and generating testable code is not just ... us to cover all cases, ensuring that every...
Read more >Testing Components depending on Services - Testing Angular
It does not have side effects we need to suppress in the testing ... constant later to check whether the Component uses the...
Read more >Changelog - Cypress Documentation
Cypress component tests now correctly load assets with Angular. Fixes #23797. Imports in component testing support files are no longer tree-shaken by Webpack....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Removing emitDecoratorMetadata from tsconfig.base.json did it for me - I also removed some hardcoded istanbul/karma/jasmine deps
Can confirm this issue still exists in
15.2.4
. RemovingemitDecoratorMetadata
everywhere in our code fixes this.