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

fix: progress event expects byte size not time #276

Merged
merged 2 commits into from
Nov 3, 2019

Conversation

xg-wang
Copy link
Member

@xg-wang xg-wang commented Oct 24, 2019

Spec:

fix #274 , supersedes #275
cc @seanjohnson08 @mike-north


TODO:

  • all existing tests continue to pass
  • we write a new test that would have failed before this code change, and now passes due to the alteration of how the progress events are handled
  • we include great documentation around "handling uploads with Pretender"

Copy link

@seanjohnson08 seanjohnson08 left a comment

Choose a reason for hiding this comment

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

Looks great! wondering if you can fix the typo in "elapsed"? :)

@mike-north
Copy link
Member

mike-north commented Oct 25, 2019

awesome. I'm fine with treating this as a "fix" and making an accompanying patch version bump, providing

  • all existing tests continue to pass
  • we write a new test that would have failed before this code change, and now passes due to the alteration of how the progress events are handled
  • we include great documentation around this aspect of Pretender, so others don't have to work quite so hard to figure things out as @seanjohnson08 did

@xg-wang xg-wang force-pushed the progress branch 2 times, most recently from 3ad4d83 to 1351dac Compare October 25, 2019 16:40
@xg-wang
Copy link
Member Author

xg-wang commented Oct 25, 2019

Looks great! wondering if you can fix the typo in "elapsed"? :)

Good catch! Fixed now.

@xg-wang
Copy link
Member Author

xg-wang commented Oct 25, 2019

@mike-north I pushed 2 commits, first failling test looks like:

PhantomJS 2.1.1 (Linux 0.0.0) pretender invoking async requests with `onprogress` upload events in the upload  trigger a progress event each 50ms FAILED
	ProgressEvent has total of requestBody byte size
	Expected: 9
	Actual: 300

Also added a section in readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fake progress event contains incorrect "loaded" and "total" values
3 participants