Compatibility for fetch-mock using proxy-pollyfill#736
Merged
JakeChampion merged 2 commits intoJakeChampion:masterfrom May 27, 2020
Merged
Compatibility for fetch-mock using proxy-pollyfill#736JakeChampion merged 2 commits intoJakeChampion:masterfrom
JakeChampion merged 2 commits intoJakeChampion:masterfrom
Conversation
Fixes wheresrhys/fetch-mock#415 Details: fetch-mock wraps the Response object in an ES6 Proxy to provide useful test harness features such as flush. However, on ES5 browsers without fetch or Proxy support pollyfills must be used; the proxy-pollyfill is unable to proxy an attribute unless it exists on the object before the Proxy is created. This change ensures Response.bodyUsed exists on the instance, while maintaining the semantic of setting Request.bodyUsed in the constructor before _initBody is called.
RamboKBR
approved these changes
Jan 15, 2020
Contributor
Author
|
I'm not sure why this build failed. Do you need me to look into it? |
This was referenced May 23, 2020
Contributor
Author
|
Thank you! |
|
Any plans to release this change to NPM? |
Owner
3.1.0 has just been released 👍 |
|
Thanks a lot! |
This was referenced May 30, 2021
This was referenced Jun 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes wheresrhys/fetch-mock#415
Details: fetch-mock wraps the Response object in an ES6 Proxy to
provide useful test harness features such as flush. However, on
ES5 browsers without fetch or Proxy support pollyfills must be used;
the proxy-pollyfill is unable to proxy an attribute unless it exists
on the object before the Proxy is created. This change ensures
Response.bodyUsed exists on the instance, while maintaining the
semantic of setting Request.bodyUsed in the constructor before
_initBody is called.