Skip to content

Commit 016b378

Browse files
authored
Offer precision as a parameter
1 parent 9fc8bc9 commit 016b378

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/TestingExtensions/SnapshotTestBase.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ open class SnapshotTestBase: XCTestCase {
3333
_ view: V,
3434
devices: [(name: String, device: ViewImageConfig)]? = nil,
3535
style: [UIUserInterfaceStyle] = [.unspecified],
36+
imageDiffPrecision: Float = 1.0,
3637
file: StaticString = #file,
3738
testName: String = #function,
3839
line: UInt = #line
@@ -56,7 +57,7 @@ open class SnapshotTestBase: XCTestCase {
5657

5758
assertSnapshot(
5859
matching: vc,
59-
as: .image(on: config.device),
60+
as: .image(on: config.device, precision: imageDiffPrecision),
6061
file: file,
6162
testName: "\(testName)-\(config.name)\(suffix)",
6263
line: line

0 commit comments

Comments
 (0)