The project I’m working in has been getting a lot of very large refactors lately.
Nearly every one of these big refactors has resulted in SwiftUI previews breaking due any of several reasons. (For example, missing environment variables causing the previews to crash.)
Devs could just make sure that previews work before making a pull request, but we all know not everyone will do that, especially since some devs just don’t use previews at all.
Is there way to write a unit test that guarantees that my previews build? Maybe something like this?
XCTAssertNoThrow(ContentView_Previews())