You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am interested in creating a mock of fetch/node-fetch with a custom HTTP server. I found myself re-implementing conversions between Node types and WHATWG types (e.g. RequestInit -> RequestOptions, ServerResponse -> Response). This work is quite tedious and error-prone.
One could extract this logic from node-fetch to another package. I also see an opportunity for the future: it seems fetch, Request and Response will become stable at the same time, but what about node:http? I think this conversion use case will become increasingly common even after fetch goes stable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am interested in creating a mock of
fetch/node-fetch
with a custom HTTP server. I found myself re-implementing conversions between Node types and WHATWG types (e.g.RequestInit -> RequestOptions
,ServerResponse -> Response
). This work is quite tedious and error-prone.One could extract this logic from
node-fetch
to another package. I also see an opportunity for the future: it seemsfetch
,Request
andResponse
will become stable at the same time, but what aboutnode:http
? I think this conversion use case will become increasingly common even afterfetch
goes stable.Beta Was this translation helpful? Give feedback.
All reactions