can-fixture
can-fixture copied to clipboard
Support the fetch API
can-fixture currently only intercepts XHR requests. It would be nice if it also supports the fetch API.
Something like https://github.com/werk85/fetch-intercept might help us implement this easily.
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