-
Notifications
You must be signed in to change notification settings - Fork 12
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
Generate sample test cases for collections #32
Labels
Comments
That's a cool idea, tho apart from just creating the test structure and maybe asserting the data types and testing a few limit cases (like wrong input and so on) I don't believe that we could really generate useful tests. And sadly including Escape like tests (even small ones) would be really hard. I'll let the issue open for now but I don't think is a priority for now, tho any suggestions are welcomed. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GraphQL is a very declarative query language. It provides a declarative approach to data fetching. From the schema, you already know what kind of data to expect and you can choose to request just what you need.
Postman has something called postman scripts that can be used to write unit-like tests. Its assertion and test suite were built atop mocha and chai making it quite similar in usage to them.
Postman scripts can be written and run in the tests tab in Postman, which is a NodeJS runtime environment for collections.
Because of the declarative nature of GraphQL, it is possible to generate sample test cases for GraphQL APIs on postman collections. It doesn't have to be anything fancy, it could be just very basic data validation checks for s start.
I am not familiar with what Escape provides, but we could also have a few security test cases that are auto-generated and can be run on the fly.
The text was updated successfully, but these errors were encountered: