-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
constructor coverage for angular is not correct anymore #12132
Comments
I'm seeing this too. |
We're also experiencing this issue with Nx 14.8.0. Downgrading |
Update: in our case, downgrading
Going to look deeper into |
I'll add that we're using Karma as our test runner. Unsure why downgrading |
Removing emitDecoratorMetadata from tsconfig.base.json did it for me - I also removed some hardcoded istanbul/karma/jasmine deps |
Removing |
According to this article, it appears Angular 12+ no longer requires
|
The problem with disabling |
FYI, to reproduce the issue, run the following:
Add an injectable to the component's constructor (anything, really). For example:
Then, run the tests:
You'll see the Branches coverage is at 75%, but when you look at the coverage report, it's highlighting something incorrectly. |
Can confirm this issue still exists in |
Hi all, this isn't really an Nx thing but an issue with istabul coverage reporter. @mandarini has an execllent write up over steps you can take to help resolve the issue. mandarini/isolatedm-jest |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current 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: nrwl/nx-examples#229
yarn nx products:test
The text was updated successfully, but these errors were encountered: