I just spent the last few days trying to debug an issue with my tests, and I think I've figured out what part of the problem was. I currently have a hack to workaround this, so it's not critical.
I was trying to test the login flow for my application, which looks like the following:
But the problem arises with the first race() call. It seems that what happens is that my provider gets called for the first race({ authLoop, logout }), and then my provider calls next(), which seems to execute it in-place, skipping subsequent provider checks. I know this because I had a matchers.call.fn(api.auth.refreshAccessToken) that wasn't being called when it should have been.
For now, my workaround has been to match the delay() calls and try to differentiate them based on the arguments being passed.
My question is, is my return next() call incorrect? Or is this a bug?
I just spent the last few days trying to debug an issue with my tests, and I think I've figured out what part of the problem was. I currently have a hack to workaround this, so it's not critical.
I was trying to test the login flow for my application, which looks like the following:
Ideally, I would have used
expectSaga(loginFlow).provide([...])
with the following provider:But the problem arises with the first
race()
call. It seems that what happens is that my provider gets called for the firstrace({ authLoop, logout })
, and then my provider callsnext()
, which seems to execute it in-place, skipping subsequent provider checks. I know this because I had amatchers.call.fn(api.auth.refreshAccessToken)
that wasn't being called when it should have been.For now, my workaround has been to match the
delay()
calls and try to differentiate them based on the arguments being passed.My question is, is my
return next()
call incorrect? Or is this a bug?