From e73e31738ff3ca7cb076ac239f5ce30f92fe5102 Mon Sep 17 00:00:00 2001 From: Aleksey Berezka Date: Sun, 21 Jun 2026 15:28:18 +0500 Subject: [PATCH] Fix deprecated verifySnapshot(record:) call in generated tests The generated PreviewTests called verifySnapshot/assertSnapshot with the Bool 'record' overload, deprecated in swift-snapshot-testing 1.15+ in favor of 'record: SnapshotTestingConfiguration.Record?'. In projects building tests with warnings-as-errors this fails the build. Map the Bool to Record the same way swift-snapshot-testing's own compatibility shim does: true -> .all, false -> .missing. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Sources/PrefireCore/Templates/PreviewTestsTemplate.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PrefireExecutable/Sources/PrefireCore/Templates/PreviewTestsTemplate.swift b/PrefireExecutable/Sources/PrefireCore/Templates/PreviewTestsTemplate.swift index 3530dee..98dc21d 100644 --- a/PrefireExecutable/Sources/PrefireCore/Templates/PreviewTestsTemplate.swift +++ b/PrefireExecutable/Sources/PrefireCore/Templates/PreviewTestsTemplate.swift @@ -139,7 +139,7 @@ import SnapshotTesting traits: prefireSnapshot.traits ) ), - record: preferences.record{% if argument.file %}, + record: preferences.record ? .all : .missing{% if argument.file %}, file: file{% endif %}, testName: prefireSnapshot.name ) @@ -151,7 +151,7 @@ import SnapshotTesting SnapshotTesting.assertSnapshot( matching: vc, as: .wait(for: preferences.delay, on: .accessibilityImage(showActivationPoints: .always)){% if argument.file %}, - record: preferences.record, + record: preferences.record ? .all : .missing, file: file{% endif %}, testName: prefireSnapshot.name + ".accessibility" )