From 0114fefb36122030218ec9116f64ad32b222358a Mon Sep 17 00:00:00 2001 From: Lizz Clark <44777792+lizzclark@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:22:13 +0000 Subject: [PATCH] store paths of accessed snapshot files --- Sources/SnapshotTesting/AssertSnapshot.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/SnapshotTesting/AssertSnapshot.swift b/Sources/SnapshotTesting/AssertSnapshot.swift index 552077e4..bfd5d0fa 100644 --- a/Sources/SnapshotTesting/AssertSnapshot.swift +++ b/Sources/SnapshotTesting/AssertSnapshot.swift @@ -8,6 +8,8 @@ import XCTest /// ``` public var diffTool: String? = nil +public var accessedFilePaths: Set = [] + /// Whether or not to record all new references. public var isRecording = false @@ -226,6 +228,8 @@ public func verifySnapshot( .appendingPathExtension(snapshotting.pathExtension ?? "") let fileManager = FileManager.default try fileManager.createDirectory(at: snapshotDirectoryUrl, withIntermediateDirectories: true) + + accessedFilePaths.insert(snapshotFileUrl) let tookSnapshot = XCTestExpectation(description: "Took snapshot") var optionalDiffable: Format?