Skip to content
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

Split progress event handlers into upload and download. #423

Merged
merged 7 commits into from
Aug 23, 2016

Conversation

diesal11
Copy link
Contributor

@diesal11 diesal11 commented Aug 22, 2016

Splits progress config into two options, progressDownload and progressUpload. No longer limits these to GET/POST/PUT requests.

Previously there were no tests for progress handling...so i've added some. But testing is difficult as the Jasmine-AJAX plugin doesn't handle xhr.upload.addEventListener correctly. Im also not overly familiar with Jasmine and it's tools so if you have any ideas on how i could improve the tests please let me know :)

At some point in future i'll do a PR to allow progress events in the Node world.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.03%) to 93.947% when pulling 10a986c on diesal11:master into 59080e6 on mzabriskie:master.

// as well as 'GET' downloads
progress: function (progressEvent) {
// `progressUpload` allows handling of progress events for uploads
progressUpload: function (progressEvent) {
Copy link
Member

@nickuraltsev nickuraltsev Aug 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to rename progressUpload and progressDownload to onUploadProgress and onDownloadProgress respectively.

… events before attaching.

Updated tests to use Spies.
@diesal11
Copy link
Contributor Author

@nickuraltsev the Jasmine AJAX fakeXHR hasn't implemented upload events. So i can't do any tests on that yet. I'm gonna create an issue/PR over there so we can test this properly, not sure if you wanna wait for that before merging this.

In the meantime i've switched the tests to use spies which is much nicer.

@coveralls
Copy link

Coverage Status

Coverage decreased (-23.7%) to 69.211% when pulling 2dffe90 on diesal11:master into 59080e6 on mzabriskie:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.03%) to 93.947% when pulling 3f5d411 on diesal11:master into 59080e6 on mzabriskie:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.03%) to 93.947% when pulling bcad5b1 on diesal11:master into 59080e6 on mzabriskie:master.

@nickuraltsev
Copy link
Member

@diesal11 Thank you! Could you please also rename the config options in README.md? Everything else looks good to me.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.03%) to 93.947% when pulling f623809 on diesal11:master into 59080e6 on mzabriskie:master.

@nickuraltsev nickuraltsev merged commit 63f41b5 into axios:master Aug 23, 2016
@nickuraltsev
Copy link
Member

@diesal11 Merged. Thank you for the PR!

@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants