jest-fetch-mock icon indicating copy to clipboard operation
jest-fetch-mock copied to clipboard

First argument to fetch should be allowed to be any stringifiable

Open DougReeder opened this issue 3 years ago • 2 comments

fetch allows the first argument to be a Request or "A string or any other object with a stringifier — including a URL object — that provides the URL of the resource you want to fetch."

If the first argument to fetch is not a string or Request, but does have a .toString() method, that should be called, instead of throwing the error "Unable to parse input as string or Request"

DougReeder avatar Jun 01 '22 13:06 DougReeder

I see code for this was added on 2021-03-19 by Matthew Simpson. The "instagram" test appears to test this. I will investigate why it's not working for me.

DougReeder avatar Jun 01 '22 15:06 DougReeder

Ah, there hasn't been a release in two years. May I suggest it's time to publish version 3.0.4 to NPM?

DougReeder avatar Jun 01 '22 15:06 DougReeder

Just noting that I ran into this as well, has it been released?

blissdev avatar Dec 23 '22 00:12 blissdev

This appears to be a duplicate of https://github.com/jefflau/jest-fetch-mock/issues/192

arumsey avatar Jan 16 '23 20:01 arumsey

Indeed it is. What can be done to get a new release out?

DougReeder avatar Jan 18 '23 15:01 DougReeder