Unit Test the Observation Framework

<p>When I heard about the new Observation framework in WWDC 2023, like all good fans of Combine (we still exist!), I was naturally horrified.</p> <p>Combine is no longer an implementation detail of SwiftUI. Our hard-earned knowledge of testing&nbsp;<code>@Published</code>&nbsp;properties is deprecated.</p> <p>Today, we&rsquo;re going to discover how to unit test&nbsp;<code>@Observable</code>&nbsp;view models.</p> <p>This is a sequel to my six-part epic,&nbsp;<a href="https://medium.com/better-programming/async-unit-testing-in-swift-eed4927480cd" rel="noopener">Async Unit Testing in Swift</a>. I&rsquo;ll be updating&nbsp;<a href="https://github.com/jacobsapps/bev17/tree/main" rel="noopener ugc nofollow" target="_blank">Bev</a>, my trusty, boozy side project, to iOS 17 while maintaining full test coverage.</p> <p><a href="https://betterprogramming.pub/unit-test-the-observation-framework-d0f0fe240944"><strong>Website</strong></a></p>