diff --git a/Sources/SnapshotTesting/AssertSnapshot.swift b/Sources/SnapshotTesting/AssertSnapshot.swift index 25aed26f..fefe1e6f 100644 --- a/Sources/SnapshotTesting/AssertSnapshot.swift +++ b/Sources/SnapshotTesting/AssertSnapshot.swift @@ -419,10 +419,9 @@ public func verifySnapshot( if !attachments.isEmpty { #if !os(Linux) && !os(Windows) - if - ProcessInfo.processInfo.environment.keys.contains("__XCODE_BUILT_PRODUCTS_DIR_PATHS"), + if ProcessInfo.processInfo.environment.keys.contains("__XCODE_BUILT_PRODUCTS_DIR_PATHS"), !isSwiftTesting - { + { XCTContext.runActivity(named: "Attached Failure Diff") { activity in attachments.forEach { activity.add($0) diff --git a/Tests/InlineSnapshotTestingTests/AssertInlineSnapshotSwiftTests.swift b/Tests/InlineSnapshotTestingTests/AssertInlineSnapshotSwiftTests.swift index 382db962..9a5d324e 100644 --- a/Tests/InlineSnapshotTestingTests/AssertInlineSnapshotSwiftTests.swift +++ b/Tests/InlineSnapshotTestingTests/AssertInlineSnapshotSwiftTests.swift @@ -27,7 +27,7 @@ """ ▿ 2 elements - "Hello" - + """ } } matching: { issue in diff --git a/Tests/SnapshotTestingTests/SwiftTestingTests.swift b/Tests/SnapshotTestingTests/SwiftTestingTests.swift index 7127981c..d7fba7af 100644 --- a/Tests/SnapshotTestingTests/SwiftTestingTests.swift +++ b/Tests/SnapshotTestingTests/SwiftTestingTests.swift @@ -1,25 +1,26 @@ #if compiler(>=6) && canImport(Testing) -import Testing -import SnapshotTesting + import Testing + import SnapshotTesting -@Suite(.snapshots(diffTool: "ksdiff")) -struct SwiftTestingTests { - @Test func testSnapshot() { - assertSnapshot(of: ["Hello", "World"], as: .dump) - } + @Suite(.snapshots(diffTool: "ksdiff")) + struct SwiftTestingTests { + @Test func testSnapshot() { + assertSnapshot(of: ["Hello", "World"], as: .dump) + } - @Test func testSnapshotFailure() { - withKnownIssue { - assertSnapshot(of: ["Goodbye", "World"], as: .dump) - } matching: { issue in - issue.description.hasSuffix(""" - @@ −1,4 +1,4 @@ -  ▿ 2 elements - − - "Hello" - + - "Goodbye" -   - "World" - """) + @Test func testSnapshotFailure() { + withKnownIssue { + assertSnapshot(of: ["Goodbye", "World"], as: .dump) + } matching: { issue in + issue.description.hasSuffix( + """ + @@ −1,4 +1,4 @@ +  ▿ 2 elements + − - "Hello" + + - "Goodbye" +   - "World" + """) + } } } -} #endif