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

refactor: extract create-passthrough & interceptor #257

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

givanse
Copy link
Contributor

@givanse givanse commented Apr 12, 2019

No business logic changes, just:

  • extract createPassthrough to its own file
  • extract interceptor to its own file

src/index.ts Outdated
// properties to copy from the native xhr to fake xhr
var lifecycleProps = ['readyState', 'responseText', 'responseXML', 'status', 'statusText'];

var xhr = fakeXHR._passthroughRequest = new ctx.pretender._nativeXMLHttpRequest();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ctx.pretender._nativeXMLHttpRequest was a closure and now it is an argument for the function.

@givanse givanse changed the title refactor: extract create-passthrough refactor: extract create-passthrough & interceptor Apr 12, 2019
@xg-wang xg-wang force-pushed the refactor-create-passthrough branch from 00aa8f2 to d9264ea Compare April 20, 2020 05:06
@xg-wang xg-wang force-pushed the refactor-create-passthrough branch from d9264ea to 5450c3a Compare April 20, 2020 05:15
@xg-wang xg-wang force-pushed the refactor-create-passthrough branch from 5450c3a to f73f7bd Compare April 20, 2020 05:24
@xg-wang xg-wang merged commit e25f0c5 into pretenderjs:master Apr 20, 2020
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.

2 participants