From 8b19f216349080ca8495351b8deea72a13bed987 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 6 Aug 2024 19:03:21 -0700 Subject: [PATCH] Remove custom test trait --- .../SnapshotTesting/SnapshotsTestTrait.swift | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 Sources/SnapshotTesting/SnapshotsTestTrait.swift diff --git a/Sources/SnapshotTesting/SnapshotsTestTrait.swift b/Sources/SnapshotTesting/SnapshotsTestTrait.swift deleted file mode 100644 index 6b4b82f7..00000000 --- a/Sources/SnapshotTesting/SnapshotsTestTrait.swift +++ /dev/null @@ -1,52 +0,0 @@ -#if canImport(Testing) - @_spi(Experimental) import Testing - - @_spi(Experimental) - extension Trait where Self == _SnapshotsTestTrait { - /// Configure snapshot testing in a suite or test. - /// - /// - Parameters: - /// - record: The record mode of the test. - /// - diffTool: The diff tool to use in failure messages. - public static func snapshots( - record: SnapshotTestingConfiguration.Record? = nil, - diffTool: SnapshotTestingConfiguration.DiffTool? = nil - ) -> Self { - _SnapshotsTestTrait( - configuration: SnapshotTestingConfiguration( - record: record, - diffTool: diffTool - ) - ) - } - - /// Configure snapshot testing in a suite or test. - /// - /// - Parameter configuration: The configuration to use. - public static func snapshots( - _ configuration: SnapshotTestingConfiguration - ) -> Self { - _SnapshotsTestTrait(configuration: configuration) - } - } - - /// A type representing the configuration of snapshot testing. - @_spi(Experimental) - public struct _SnapshotsTestTrait: CustomExecutionTrait, SuiteTrait, TestTrait { - public let isRecursive = true - let configuration: SnapshotTestingConfiguration - - public func execute( - _ function: @escaping () async throws -> Void, - for test: Test, - testCase: Test.Case? - ) async throws { - try await withSnapshotTesting( - record: configuration.record, - diffTool: configuration.diffTool - ) { - try await function() - } - } - } -#endif