redux-logic icon indicating copy to clipboard operation
redux-logic copied to clipboard

warnTimeout: 0 and store.whenComplete()

Open lstkz opened this issue 8 years ago • 1 comments

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?

lstkz avatar May 11 '17 10:05 lstkz

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.

lstkz avatar May 16 '17 09:05 lstkz