[solved] Testing/Mocking Quasar File Uploader in Jest
beatscribe last edited by beatscribe
So I have a standard Uploader setup in my Quasar v1 project, the file is just submitted via API. I am super unclear on how to make Jest test for this. I can make a simple Express server and just actually hit that API and get a response, but it seems like there might be a better way to mock the response in Jest. Has anyone else done such a unit test?
beatscribe last edited by
So it isn’t idea, but I came up with this:
In Jest, I test the functions the completed/failed events from QUploader call. Thats about the best I could do there.
In Cypress e2e, I use Interceptor and cypress-upload package to mock an upload and the response from the API call and then actually have cypress click the upload button and judge what happens after.