Skip to content

assert all selectors are tested #42

Open
@blitmap

Description

@blitmap

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement or suggestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mikeumus@blitmap

        Issue actions

          assert all selectors are tested · Issue #42 · bevry/query-engine