mgeimer
(Matt Geimer)
1
Is there a way to write a unit test for an ObservableObject class?
Jon_Shier
(Jon Shier)
2
In what way? You can observe @Published properties and test them pretty easily, but since the objectWillChange publisher's default implementation only works with SwiftUI, if you want to test the observability of the whole object you'll need to provide your own, which is pretty easy, though I'm not sure if it's worth it.
1 Like
mgeimer
(Matt Geimer)
3
I figured out what I was doing wrong. I was not using the @testable tag for my imports.