jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
881 stars 116 forks source link

First argument to fetch should be allowed to be any stringifiable #234

Closed DougReeder closed 1 year ago

DougReeder commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

blissdev commented 1 year ago

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

arumsey commented 1 year ago

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

DougReeder commented 1 year ago

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