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

fakeFetch? #720

Closed
hgl opened this Issue Mar 28, 2015 · 14 comments

Comments

Projects
None yet
10 participants
@hgl

hgl commented Mar 28, 2015

fetch is replacing xhr. I wonder if sinonjs could contain a fakeFetch that will work with fakeServer? github implements a fetch polyfill, could it be leveraged to implement the fake fetch?

@mroderick

This comment has been minimized.

Member

mroderick commented Mar 29, 2015

Instead of stuffing more into Sinon.JS, I'd rather see it implemented as a separate module. This module could offer integration with Sinon.JS.

@mantoni

This comment has been minimized.

Member

mantoni commented Mar 29, 2015

Isn't the plan to move the whole fake server into a separate module? And why shouldn't fetch be part of that module? I'm wondering where we want to draw the line.

@mroderick

This comment has been minimized.

Member

mroderick commented Mar 30, 2015

Isn't the plan to move the whole fake server into a separate module?

That was my understanding

And why shouldn't fetch be part of that module? I'm wondering where we want to draw the line.

As long as it's not in Sinon.JS directly, I am happy. Whether we make one module to rule them all, or many small(er) modules is not that important to me

@mantoni

This comment has been minimized.

Member

mantoni commented Mar 30, 2015

👍

@hgl

This comment has been minimized.

hgl commented Mar 30, 2015

Thanks for the heads up. Sounds reasonable.

So what the separate fake server module will look like (and when will it happen)? I doubt fake fetch could be implemented without this module in place.

@thisguychris

This comment has been minimized.

thisguychris commented Jul 21, 2015

👍 very excited on having this feature

@rybex

This comment has been minimized.

rybex commented Sep 14, 2015

It would be nice to add this feature 👍

@screendriver

This comment has been minimized.

screendriver commented Oct 2, 2015

👍 for fakeFetch

@ibash

This comment has been minimized.

Contributor

ibash commented Aug 12, 2016

Question for people that want this feature, is the expectation that you'd be able to call fakeServer.respondWith(...) and the server would fake the response for request for XMLHttpRequest and fetch? Or would it be that you create a server for each type?

This doesn't seem like it would be a crazy amount of work to implement.

@jehon

This comment has been minimized.

jehon commented Dec 16, 2016

Hello
To my point of vue, I only use fetch. Thus the reply to your questions would be: anyway are good for me.
But since not all the browser support fetch, some people use polyfill for fetch, based on XmlHttpRequest.
I would thus suggest more of fake response for both toguether to ease testing all browser the same way...

Did you start working on this?
Have a nice day!

@fatso83

This comment has been minimized.

Contributor

fatso83 commented Dec 17, 2016

@ibash I think your first proposal is the soundest. One server to rule them all. It is just HTTP after all.

@darrenfu

This comment has been minimized.

darrenfu commented Apr 10, 2017

Any update to this feature?

@fatso83

This comment has been minimized.

Contributor

fatso83 commented Apr 10, 2017

@darrenfu no. someone needs to put in the hours. You do not have to wait for a separate repo or module for this to be implemented either (which @hgl hinted at). Just interface with the existing module that lives in Sinon. Later on those server bits could of course be extracted.

@mroderick

This comment has been minimized.

Member

mroderick commented May 27, 2017

I would recommend looking at these libraries for faking fetch

Since no one has stepped up to resolve this issue with a PR for more than two years, I am closing it

@mroderick mroderick closed this May 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment