Skip to content

Unclear that tests actually validate their results? #222

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

Open
gregfenton opened this issue Aug 15, 2021 · 3 comments
Open

Unclear that tests actually validate their results? #222

gregfenton opened this issue Aug 15, 2021 · 3 comments
Assignees

Comments

@gregfenton
Copy link
Contributor

describe("firestore-solution-counters", () => {

In the test group that starts at the above line, it isn't clear to me that the results of the tests are actually being tested? What validates that the counters are created? What validates that the incremented value is correct?

@samtstern
Copy link
Contributor

@gregfenton most of the tests here are only to ensure that the code is syntactically valid and doesn't throw immediate exceptions. We don't test that they produce the intended backend result, although if you want to submit a PR to improve any of the tests to be more meaningful we'd be happy to review!

@gregfenton
Copy link
Contributor Author

My main concern is that this snippet is highlighted in the documentation as the source for the Distributed Counters pattern. But these tests do not show how to use the pattern. So we are left to figure things out on our own?

I'm currently struggling with this: https://github.com/gregfenton/example-firestore-distributed-counter

@samtstern
Copy link
Contributor

@gregfenton totally fair! I'm actually no longer on the Firebase team so cc @morganchen12 and @abeisgoat who may want to take a look here.

@morganchen12 morganchen12 self-assigned this Aug 19, 2021
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

3 participants