We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a9da98 commit 44f3f0fCopy full SHA for 44f3f0f
1 file changed
Sources/TestingExtensions/SnapshotTestBase.swift
@@ -51,18 +51,19 @@ open class SnapshotTestBase: XCTestCase {
51
let vc = UIHostingController(rootView: view)
52
vc.overrideUserInterfaceStyle = uiStyle
53
54
- let suffix: String
55
- switch uiStyle {
56
- case .unspecified:
57
- suffix = ""
58
- case .light:
59
- suffix = "-light"
60
- case .dark:
61
- suffix = "-dark"
62
- @unknown default:
63
- fatalError("Unhandled UIUserInterfaceStyle \(uiStyle)")
64
- }
65
-
+ let suffix: String = {
+ switch uiStyle {
+ case .unspecified:
+ return ""
+ case .light:
+ return "-light"
+ case .dark:
+ return "-dark"
+ @unknown default:
+ fatalError("Unhandled UIUserInterfaceStyle \(uiStyle)")
+ }
+ }()
66
+
67
assertSnapshot(
68
of: vc,
69
as: .image(on: config.device, precision: imageDiffPrecision),
0 commit comments