You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to write unit tests for components that use Uppy to upload files, and am using MSW to mock a file server API. The XHRUpload plugin is being used for file uploads, but MSW isn't intercepting the upload requests.
Here is a code sandbox containing a demo app that demonstrates the issue I'm seeing. Note - the app will need to be cloned locally, as it requires Node to run. To reproduce what I'm seeing, run npm run test and notice that Uppy does successfully complete the upload, but the API response is not included in the result.
Not sure if this is necessarily a feature request, as it seems like something that should be working. If there are examples of this working successfully with MSW (or any mocking library), I would definitely appreciate a link to an example.
The text was updated successfully, but these errors were encountered:
Hi, I'm not sure what is going on but I do know @uppy/xhr works as it should an implementing the receiving end is up to the implementer. I'm sorry I don't have examples.
Only thing I can quickly see it your test code uses api as the endpoint but that should probably be a full URL.
I'm attempting to write unit tests for components that use Uppy to upload files, and am using MSW to mock a file server API. The XHRUpload plugin is being used for file uploads, but MSW isn't intercepting the upload requests.
Here is a code sandbox containing a demo app that demonstrates the issue I'm seeing. Note - the app will need to be cloned locally, as it requires Node to run. To reproduce what I'm seeing, run
npm run test
and notice that Uppy does successfully complete the upload, but the API response is not included in the result.Not sure if this is necessarily a feature request, as it seems like something that should be working. If there are examples of this working successfully with MSW (or any mocking library), I would definitely appreciate a link to an example.
The text was updated successfully, but these errors were encountered: