Replies: 1 comment 1 reply
-
@Miiha This behavior is actually intentional, though nuanced for sure. We think it's perfectly reasonable to delay failure till the dependency is actually used, and allow for effects and clients to be referenced outside of failure. For example: let effect = environment.apiClient.fetchCurrentUser()
.catchToEffect(Action.currentUserResponse)
Does this make sense? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I recently started adopting the new
XCTUnimplemented
functions provided through xctest-dynamic-overlay.It really cleans a lot of boilerplate code for the test setup code.
I also used it on closures that return an
Effect
, which worked for most of the unit tests.But for tests that were testing code working with e.g
debounce
, I encountered an odd behaviour and unexpected failures in the tests.The reason is, that the
.failing
(now.unimplemented
) effect fails the test when the effect is actually run by the store.XCTUnimplemented
fails immediately when the closure is called, not when the effect is run.Would it make sense to have a version of
XCTUnimplemented
, dedicated to the TCA'sEffect
, which provides the.failing
/.unimplemented
behaviour?I wonder if others might also assume that
XCTUnimplemented
would be applicable for scenarios whereEffect.unimlemented
is used.Cheers,
Micha
Beta Was this translation helpful? Give feedback.
All reactions