-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
XMLHttpRequest: Support "upload" events #187
Comments
hi @kettanaito, is there any chance that this will get fixed in the near future? |
Hey, @eudinnou. This task is not on my list at the moment so I don't know when I'll get to it. That being said, you and anybody else are welcome to open a pull request with the implementation for XMLHttpRequest events. I believe I've described what has to be done in the issue's description. If you feel like making this happen, let me know and I will help you during the code reviews. |
Released: v0.18.0 🎉This has been released in v0.18.0! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
cool, but unfortunately it doesn't work with MSW itself :/
|
@KKrisu, MSW uses Interceptors v17 right now so this change is respectively not present there yet. It will be added with the Fetch API support later this year. |
ok, we need to wait then, thank you @kettanaito |
@kokiy please do not update https://github.com/mswjs/msw/blob/2633fa93af4bcbc33f12f69a6b83193684c3dfd3/package.json#L91 What you're doing is installing the next breaking version (0.18.0). Of course, things will break, they are promised to break. |
will MSW 1 be updated to use mswjs/interceptors@0.18 or above? |
Is this update now available in the latest version of Looking at the https://github.com/mswjs/msw/blob/8011bdea3d12e8236db21730a3418708fbcca1e4/package.json#L119 Thank you! |
@jaredhill4, yes, the latest MSW ( |
The
upload
property on the XMLHttpRequest returns aXMLHttpRequestUpload
instance, which is similar to an event emitter. The consumer may use theupload
instance to attach listeners on the request body upload progress.We should enable the
upload
events for both mocked and bypassed requests.Event order
The upload events are called in the following order, given request body:
loadstart
, request body is known, thelengthComputable
value on theProgressEventInit
is set to a boolean representing if there's any upload work to be done (request has body).progress
, request body is known and read, the progress event containsloaded
andtotal
of transferred request body bytes.load
.loadend
, the upload is over.The text was updated successfully, but these errors were encountered: