can-fixture icon indicating copy to clipboard operation
can-fixture copied to clipboard

Support the fetch API

Open jeroencornelissen opened this issue 8 years ago • 2 comments

can-fixture currently only intercepts XHR requests. It would be nice if it also supports the fetch API.

jeroencornelissen avatar Oct 04 '17 13:10 jeroencornelissen

Something like https://github.com/werk85/fetch-intercept might help us implement this easily.

bmomberger-bitovi avatar Oct 04 '17 17:10 bmomberger-bitovi

Looking at the code it appears that that library doesn't prevent the request from occurring. I think it's for modifying requests/responses, as a sort of aspect-oriented programming mechanism. But the fetch still occurs. https://github.com/werk85/fetch-intercept/blob/2786b54e83afa6b5bc1cf6ba2eb31fb5b32d7526/src/attach.js#L20

matthewp avatar Mar 20 '19 12:03 matthewp