Open lstkz opened 7 years ago
I am using redux-logic-test for testing. I have a logic that initializes the socket and dispatches actions. warnTimeout is set to 0.
redux-logic-test
warnTimeout
0
In my unit tests, I call await store.whenComplete(), but it causes timeouts because the logic never calls the done() callback.
await store.whenComplete()
done()
If I call done(), all actions are ignored when I call dispatch({...}). Is there any workaround for this?
dispatch({...})
Instead of calling await store.whenComplete(), I add a small delay await Promise.delay(10), and it solves this issue. Or jest.runTimersToTime(10) when using a jest framework.
await Promise.delay(10)
jest.runTimersToTime(10)
jest
I am using
redux-logic-test
for testing. I have a logic that initializes the socket and dispatches actions.warnTimeout
is set to0
.In my unit tests, I call
await store.whenComplete()
, but it causes timeouts because the logic never calls thedone()
callback.If I call
done()
, all actions are ignored when I calldispatch({...})
. Is there any workaround for this?