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

Serialization of fetch request needs implementation #331

ksaaskil opened this issue Oct 23, 2019 · 0 comments


Copy link

@ksaaskil ksaaskil commented Oct 23, 2019

unmock-fetch package contains a method for creating a "fake" fetch that's expected to implement the Fetch API. When a user creates a call with the fake fetch, the request should be serialized to an ISerializedRequest object. There's a crude implementation for serialize.ts that does not yet handle request headers or body.

I have written tests for the serialization features. They're skipped as they don't work yet, so the task would be to make those tests pass.

Note that the fetch interface also does not implement the case where "url" is not a plain string but a Request object. That would be a task for another PR.

In summary, we would need:

  • Serializing request headers
  • Filling "path" with the full path containing the search parameters
  • Serializing request body
  • Implementing serialization for the case where the input "url" is a Request object

Each of these could be a PR of their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.