redux-logic
redux-logic copied to clipboard
warnTimeout: 0 and store.whenComplete()
I am using redux-logic-test for testing.
I have a logic that initializes the socket and dispatches actions.
warnTimeout is set to 0.
In my unit tests, I call await store.whenComplete(), but it causes timeouts because the logic never calls the done() callback.
If I call done(), all actions are ignored when I call dispatch({...}).
Is there any workaround for this?
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.