Replies: 1 comment 3 replies
-
@jjnino Ha have you been reading our transcripts early? 😉 Combine absolutely allows us to write deterministic tests, and we'll be showing just that later in the series. But then the giant elephant in the room is why should we eschew Swift's modern concurrency tools whenever we want to write tests? Combine makes application code (and tests) a bit more complex, so ideally we would be able to use Also, judging from WWDC23, |
Beta Was this translation helpful? Give feedback.
-
Hey @stephencelis & @mbrandonw Very interesting episode this week and something I have run into as well. I was wondering if y'all explored using the publisher on the
@Published
properties on the models to create expectations that can be awaited? I know it is not a great solution to the problem posed in the episode and would only really work for models that have@Published
properties, but in the example of thefact
going tonil
orloading
flipping totrue
, one could make the testing deterministic by introducing a subscriber to the @published properties subscriber. For exampletestFactIsLoading
could be written as:I think that would make it deterministic. Anyway, y'all probably have considered this already. I was curious if y'all thought this was a good approach? It can help with exhaustiveness but only works in some cases and feels clunky.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions