EasyGraphQL / easygraphql-tester

Test GraphQL queries, mutations and schemas on an easy way! 🚀
https://easygraphql.com/docs/easygraphql-tester/overview
MIT License
314 stars 34 forks source link

New feature to test file upload #87

Open baconYao opened 5 years ago

baconYao commented 5 years ago

This is an amazing project! Thanks for your effort. Do you have plan to develop new feature about uploading file?

estrada9166 commented 5 years ago

Thanks for creating this issue!

It sounds something nice to have, I was thinking to add first a new method that can be used to test the whole resolver, maybe it can be useful to test the file uploading, what do you think?

baconYao commented 5 years ago

I'm a bit confused about the method you said. But I am very much looking forward to it. Would you mind sharing your thoughts? Maybe we can discuss together.

estrada9166 commented 5 years ago

Sure! What I'm thinking is using tester.graphql() and it will execute the mutation with the resolver... so, in case you're uploading a file, you can use sinon stub to stub the upload and return a custom value; that way you can test the whole resolver :)

Also, if you want to share how you are doing it, we can see how we can create a test case to it!

You can use this codesandbox so we can test it there