diff --git a/Sources/SnapshotTesting/AssertSnapshot.swift b/Sources/SnapshotTesting/AssertSnapshot.swift index 552077e49..bfd5d0fa6 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?