You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests sometimes fail without Task.sleep because it's checking the state too early. Since state updates happen asynchronously, we need to wait a bit to ensure the new values are ready.
Although using Task.sleep works, it's not the most elegant solution. Instead, we could make the tests more reliable by adding a way to check the state right after it updates, like this:
sut.pour(.timerProgressed(to: testCase.time)){ state in
#expect(state.displayingMinutes == testCase.expected.minutes)}
Adding a test feature for waiting Effect to have actual "effect" needs to be added.
The text was updated successfully, but these errors were encountered:
When testing state updates, we found an issue with timing. Here's the current approach:
Tests sometimes fail without
Task.sleep
because it's checking the state too early. Since state updates happen asynchronously, we need to wait a bit to ensure the new values are ready.Although using
Task.sleep
works, it's not the most elegant solution. Instead, we could make the tests more reliable by adding a way to check the state right after it updates, like this:Adding a test feature for waiting
Effect
to have actual "effect" needs to be added.The text was updated successfully, but these errors were encountered: