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

assert all selectors are tested #42

Open
blitmap opened this issue Feb 23, 2016 · 0 comments
Open

assert all selectors are tested #42

blitmap opened this issue Feb 23, 2016 · 0 comments
Labels
enhancement Improvement or suggestion

Comments

@blitmap
Copy link

blitmap commented Feb 23, 2016

Issue #41 is a result of $hasAll not having a test - I'd like to suggest that a "meta-test" be added simply to make sure all query selectors have an associated test. This would assert a certain level test coverage.

I imagine it would look something like looping over Query.selectors and making sure a key for the selector exists in queryTests:

https://github.com/bevry/query-engine/blob/master/src/documents/test/queries-test.js.coffee#L71

The selectors are defined here:

https://github.com/bevry/query-engine/blob/master/src/documents/lib/query-engine.js.coffee#L1214-L1470

It could even be as simple/naive as:

Object.keys(queryTests).length is Object.keys(Query.selectors).length

PS: If you want to get even more meta - test just $hasAll and then use that to test that queryTests has all of the keys of Query.selectors. WE CAN GO DEEPER

@mikeumus mikeumus added the enhancement Improvement or suggestion label Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or suggestion
Projects
None yet
Development

No branches or pull requests

2 participants