easygraphql-tester icon indicating copy to clipboard operation
easygraphql-tester copied to clipboard

New feature to test file upload

Open baconYao opened this issue 5 years ago • 3 comments

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

baconYao avatar Mar 06 '19 06:03 baconYao

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?

estrada9166 avatar Mar 06 '19 14:03 estrada9166

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.

baconYao avatar Mar 12 '19 08:03 baconYao

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

estrada9166 avatar Mar 12 '19 14:03 estrada9166