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,