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

"E" is not showing in the HTML reporter for "implicit else" branches after https://github.com/istanbuljs/istanbuljs/pull/633 #649

Closed
gareth-smyth opened this issue Nov 7, 2021 · 8 comments
Labels

Comments

@gareth-smyth
Copy link

Expected Behavior: how should things be working?
When an "implicit else" statement is not covered the HTML reporter should show an "E" to the left of the "if" statement.

expected

Observed Behavior: what did you observe happening instead?
The heading correctly shows that a branch is not covered but the branch is not highlighted in the code view.

actual

Code: provide a repository, or snippet of code, that reproduces the bug.

if(1 === 1) {
    console.log(1);
}

** Configuration **
Node v14.17.2
NPM 6.14.13
Running Jest 27.3.1

** Quick analysis **
If I revert the change from this PR #633 it seems to work correctly.

Thanks,
Gareth

@bcoe
Copy link
Member

bcoe commented Nov 8, 2021

@gareth-smyth thank you for the bug report 👍

@adrian-burlacu-software any thoughts on this one?

@Powerplex
Copy link

Powerplex commented Dec 6, 2021

I can confirm we have the same issue. The generated json is correct, showing "0" lines covered for missing else branches. The static website generated to show the coverage is showing a coverage lower than 100% BUT does not show where it is.

The [E] (Else branch not covered) is not showing for implicit else only. If we add a simple else { /* with nothing inside */ } then we can see the coverage is missing.

@gareth-smyth this is the exact same issue.

The generated JSON, showing that we indeed are missing coverage for the "Else" branch:

json-with-else-branch-not-covered

But when we open the reporter, unfortunately this is not showing at all like it used to:
Capture d’écran 2021-12-06 à 16 28 39

@adrian-burlacu-software
Copy link
Contributor

@bcoe
Sorry, this just hit my radar. I'll take a look to fix, hopefully by the end of the holiday break. Was lucky that I was Looking to make further improvements to this lib so I already made the time :)

Kind regards,
Adrian

@adrian-burlacu-software
Copy link
Contributor

@bcoe
Still waiting to validate, my gut feeling is that it's a downstream issue. We fixed the reporting data but not the HTML reporter.

@bcoe
Copy link
Member

bcoe commented Dec 20, 2021

@adrian-burlacu-software 👍 thank you for starting to dig into this. I felt the recent additions to the library have added more value than this bug detracts, but would be nice to fix 😄

@adrian-burlacu-software
Copy link
Contributor

@bcoe
Happy New Year to all! Fixed and fingers crossed extra tight in #663

@adrian-burlacu-software
Copy link
Contributor

adrian-burlacu-software commented Feb 6, 2022

@gareth-smyth
@Powerplex
@bcoe

Ok, fix was released in istanbul-reports 3.1.4. This issue is good to close :)

@bcoe bcoe closed this as completed Feb 6, 2022
@bcoe
Copy link
Member

bcoe commented Feb 6, 2022

@adrian-burlacu-software thanks for fixing this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants