Returning redirect from loader not working in jest (web-fetch used) #10526
Rafal-Jenczelewski
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
In my unit test env (Node 18.9.1 and jest 29.0.3)
redirect
call does not work as intended. After searching for solution, I have learned that I should use @remix-run/web-fetch to polyfillResponse
, so I did just that:but that did not fix the problem. I have debugged react-router's code and I'm pretty sure I have found the cause.
Function
isResponse
requiresresponse.body
to not beundefined
:But that check fails in my setup, even tho web-fetch should be compatible.
Beta Was this translation helpful? Give feedback.
All reactions