From 0fc2fb8bb8fac93f2be9d07df65074082ca34753 Mon Sep 17 00:00:00 2001 From: Adrian Sergheev Date: Thu, 25 Jan 2024 11:32:39 +0100 Subject: [PATCH] revert-snapshot-dependency (#7) * Revert "upgrade-snapshot-tests-dependency-fix (#5)" This reverts commit de28e39c09f8cf006204e34961604e23b50ff7c1. * Revert "Merge pull request #4 from adriansergheev/upgrade-snapshot-tests-dependency" This reverts commit 002558ca4fd896cac46a9d109b0a818dd499e144, reversing changes made to da62ebd3cda2e56788984d62a4dd4bd7eda31978. --------- Co-authored-by: Adrian Sergheev --- Package.resolved | 15 +++------------ Package.swift | 2 +- .../DemoKitSnapshot/XCTestCase+Extensions.swift | 15 +++------------ 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Package.resolved b/Package.resolved index c1029e1..0ac882f 100644 --- a/Package.resolved +++ b/Package.resolved @@ -3,19 +3,10 @@ { "identity" : "swift-snapshot-testing", "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-snapshot-testing", + "location" : "https://github.com/pimms/swift-snapshot-testing.git", "state" : { - "revision" : "8e68404f641300bfd0e37d478683bb275926760c", - "version" : "1.15.2" - } - }, - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", - "state" : { - "revision" : "43c802fb7f96e090dde015344a94b5e85779eff1", - "version" : "509.1.0" + "revision" : "b44b563e6ddc5a613a107fb57626047a7f1d4e1a", + "version" : "1.9.666" } } ], diff --git a/Package.swift b/Package.swift index ba6f618..0863a9e 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( .library(name: "DemoKitSnapshot", targets: ["DemoKitSnapshot"]), ], dependencies: [ - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", exact: "1.15.2"), + .package(url: "https://github.com/pimms/swift-snapshot-testing.git", exact: "1.9.666"), ], targets: [ .target( diff --git a/Sources/DemoKitSnapshot/XCTestCase+Extensions.swift b/Sources/DemoKitSnapshot/XCTestCase+Extensions.swift index aa8d7b6..82b9c12 100644 --- a/Sources/DemoKitSnapshot/XCTestCase+Extensions.swift +++ b/Sources/DemoKitSnapshot/XCTestCase+Extensions.swift @@ -34,9 +34,6 @@ extension XCTestCase { public func snapshotTest( demoable: any Demoable, record: Bool = false, - // https://github.com/pointfreeco/swift-snapshot-testing/pull/628#issuecomment-1256363278 - precision: Float = 0.98, - perceptualPrecision: Float = 0.98, file: StaticString = #file, line: UInt = #line ) { @@ -53,10 +50,8 @@ extension XCTestCase { performSnapshots( viewController: viewController, record: record, - testName: demoable.identifier, + testName: demoable.identifier, tweakName: tweak.testName, - precision: precision, - perceptualPrecision: perceptualPrecision, file: file, line: line ) @@ -66,8 +61,6 @@ extension XCTestCase { viewController: viewController, record: record, testName: demoable.identifier, - precision: precision, - perceptualPrecision: perceptualPrecision, file: file, line: line ) @@ -152,12 +145,11 @@ extension XCTestCase { record: Bool, testName: String, tweakName: String? = nil, - precision: Float = 0.98, - perceptualPrecision: Float = 0.98, file: StaticString, line: UInt ) { UIView.setAnimationsEnabled(false) + let subpixelThreshold: UInt8 = 5 let userInterfaceStyle: [UIUserInterfaceStyle] = [.light, .dark] userInterfaceStyle.forEach { userInterfaceStyle in @@ -173,8 +165,7 @@ extension XCTestCase { matching: viewController, as: .image( on: device.imageConfig, - precision: precision, - perceptualPrecision: perceptualPrecision, + subpixelThreshold: subpixelThreshold, traits: traits ), named: name,