Practical SwiftUI Snapshot Testing
This allows simple snapshot tests for SwiftUI views and previews.
Add Swift Package, add SwiftUI_SnapshotTesting
to a project Test target.
Optionally add PreviewGroup
to the app target, see Preview Group
See Example iOS app project with SnapshotTests.swift
func testViews() {
verifySnapshot(FavoriteView_Previews.self)
verifySnapshot(ContentView())
verifySnapshot(Text("SwiftUI").foregroundColor(.red), "example")
}
link |
Stars: 4 |
Last commit: 48 weeks ago |
enhancement #22 - generate simple default name for snapshots
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics