I expect the race to end with the action CANCEL_TASK, but this test just hangs.
If I remove while true around the backgroundTask then it works, but that's not what I want 🤷 . Without using a provide for the race, what strategy can I use to test this pattern?
Ideally, I want the backgroundTask to run 3-4 times and then dispatch CANCEL_TASK
I created a saga very similar to the one found in the redux-saga docs https://redux-saga.js.org/docs/advanced/RacingEffects.html
I'm trying to test this saga, but it's stuck in an infinite loop. Here's my test
I expect the race to end with the action
CANCEL_TASK
, but this test just hangs.If I remove
while true
around thebackgroundTask
then it works, but that's not what I want 🤷 . Without using a provide for the race, what strategy can I use to test this pattern?Ideally, I want the
backgroundTask
to run 3-4 times and then dispatchCANCEL_TASK
Versions
redux-saga: 1.1.3 redux-saga-test-plan: 4.0.0-rc.3