tophat / dont-waste-your-ducking-time

:rooster: An opinionated guide on how to test Redux ducks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saga test example does not work for redux-saga <1.0.0

noahnu opened this issue · comments

commented

Describe the bug

The duck test which "assume sagas don't exist", assumes you're using redux-saga >= 1.0.0.

To Reproduce

Using redux-saga v0.16.0, try wait for a saga to complete via:

store.dispatch(END)
await store.sagaTask.toPromise()

Expected behavior

I don't expect dont-waste-your-ducking-time to support old versions of redux-saga, so a note in the comments, or even the presence of this issue should be sufficient.

< v1.0.0 fix

This works:

store.sagaTask.cancel()
await store.sagaTask.done

@all-contributors please add @noahnu for docs

@msrose

I've put up a pull request to add @noahnu! 🎉