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

Code Coverage for Cypress Component Tests #16

Open
kurushimi0 opened this issue Mar 10, 2023 · 6 comments
Open

Code Coverage for Cypress Component Tests #16

kurushimi0 opened this issue Mar 10, 2023 · 6 comments
Assignees

Comments

@kurushimi0
Copy link

This is a wonderful project. I've been going through other online articles trying to figure out how to weave Code Coverage reports into the mix. Would you consider adding Code Coverage options into this sample application? The official Cypress documentation for Angular Component Testing currently makes no mention of Code Coverage.

@jordanpowell88 jordanpowell88 self-assigned this Mar 10, 2023
@lmiller1990
Copy link

We are working on documenting code coverage cypress-io/cypress-documentation#5519. This will happen before the end of March.

We should then add it to all the example apps -- good idea.

@elylucas
Copy link
Contributor

@lmiller1990 @jordanpowell88 adding code coverage examples is probably better suited to the cypress code coverage plugin repo (or wherever this sits now). The intended purpose of this repo is to have simple apps that can be cloned quickly for testing and demo purposes.

We tried going down the path of having more complete examples here before, but that became hard to maintain and we discussed that putting examples in the repos of the tools was a better path forward.

@elylucas
Copy link
Contributor

@lmiller1990 @jordanpowell88 heres one such example in the code coverage repo: https://github.com/cypress-io/code-coverage/tree/master/test-apps/new-cypress-config/cra-e2e-and-ct

The nice thing about adding the examples here is that they are tested as well.

@lmiller1990
Copy link

Thanks for pointing that out @elylucas - we should add more. Would that makes sense to do here or there? I'd like to automate testing around these - we could add some minimal examples there, but it might end up duplicating a lot of code between here and there.

@elylucas
Copy link
Contributor

Thanks for pointing that out @elylucas - we should add more. Would that makes sense to do here or there? I'd like to automate testing around these - we could add some minimal examples there, but it might end up duplicating a lot of code between here and there.

I think the code coverage repo makes the most sense. Its also already under automated testing and this repo is not. At one point the code coverage repo was going to be put under testing when the main app got commits, but not sure if that happened or not.

@kurushimi0
Copy link
Author

kurushimi0 commented Mar 13, 2023

@elylucas While I appreciate the desire to keep these projects as simple as possible, with component testing, code coverage seems like a pretty critical ingredient. And each framework does have different enough processes for instrumentation, etc, that the inclusion of a simple, single working sample in each of these projects would be extremely helpful. Figuring out even a bare-bones solution for code coverage in a given framework can sometimes be a non-trivial task.

Also, the other projects you linked to lack Angular examples; and they don't look like they've been kept up to date at anywhere near the same rate that these sample projects have been.

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

4 participants