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

Empty e2e coverage results #65

Closed
smitch88 opened this issue Aug 18, 2019 · 8 comments
Closed

Empty e2e coverage results #65

smitch88 opened this issue Aug 18, 2019 · 8 comments

Comments

@smitch88
Copy link

smitch88 commented Aug 18, 2019

Hey,

I'm noticing some weird coverage behavior with an instrumented front-end react app and an instrumented e2e set of specs. I've verified the counters across both front-end and spec code.

  • Showing the end result of combineCoverage

Screen Shot 2019-08-18 at 12 05 00 AM

Debugging efforts

I rewrote combineCoverage to print out a global summary and I get the following 2 results,

  • The first call to combineCoverage seems to show the proper result

Screen Shot 2019-08-18 at 12 05 26 AM

  • The second call which basically passes in an empty coverage map seems to break everything and produce an empty result.

Screen Shot 2019-08-18 at 12 05 32 AM

Conclusion

Is there some weird behavior with the merge with empty maps happening here in this code?

It could also be that this should not be running that last combineCoverage in the After lifecycle and Im not sure why its running there in the first place.

@smitch88 smitch88 changed the title Weird merge behavior in combineCoverage leading to empty e2e coverage Weird merge behavior in combineCoverage leading to empty e2e coverage, maybe? Aug 18, 2019
@smitch88
Copy link
Author

smitch88 commented Aug 18, 2019

Downgraded to 13.x.x from "nyc": "^14.1.1", and things started working properly. Looks to be an issue in 14.x.x of nyc

@smitch88 smitch88 changed the title Weird merge behavior in combineCoverage leading to empty e2e coverage, maybe? Empty e2e coverage results Aug 18, 2019
@ManuBoca92
Copy link

ManuBoca92 commented Sep 4, 2019

I am also receiving an empty coverage result when I run my e2e tests. I followed the guidelines step by step. I have also tried downgrading nyc to 13.x.x and even 12.x.x but the issue still persists.

@Farhanklenty
Copy link

Yes ,There is issue with nyc 14.1.1 just downgrade to 13.x.x it should work

@ManuBoca92
Copy link

I have tried downgrading nyc to both 13.x.x and 12.x.x. I have the following packages "istanbul-lib-coverage": "^2.0.5", "@cypress/code-coverage": "^1.10.1". Maybe nyc 13.x.x. works with a particular version of these packages?

@Farhanklenty
Copy link

i have same configuration and it is working for mine.
Are you instumented your code before running the test cases.that is the requirement.'
i have instumented using "nyc instrument" and the i am running my test case on instrumented code using "@cypress/code-coverage",i m combining code coverage and using nyc i am generating report.

@ManuBoca92
Copy link

Aha! no I did not instrumented it, thanks.

@ShamansCoding
Copy link

Yes ,There is issue with nyc 14.1.1 just downgrade to 13.x.x it should work

Downgraded to version 13.3.0, it's working now.

@bahmutov
Copy link
Contributor

ok, I will close this for now, since it is not clear that this is a problem in @cypress/code-coverage but more of the nyc problem

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

No branches or pull requests

5 participants