Skip to content

Commit

Permalink
revert-snapshot-dependency (#7)
Browse files Browse the repository at this point in the history
* Revert "upgrade-snapshot-tests-dependency-fix (#5)"

This reverts commit de28e39.

* Revert "Merge pull request #4 from adriansergheev/upgrade-snapshot-tests-dependency"

This reverts commit 002558c, reversing
changes made to da62ebd.

---------

Co-authored-by: Adrian Sergheev <[email protected]>
  • Loading branch information
adriansergheev and Adrian Sergheev authored Jan 25, 2024
1 parent de28e39 commit 0fc2fb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
15 changes: 3 additions & 12 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 3 additions & 12 deletions Sources/DemoKitSnapshot/XCTestCase+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand All @@ -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
)
Expand All @@ -66,8 +61,6 @@ extension XCTestCase {
viewController: viewController,
record: record,
testName: demoable.identifier,
precision: precision,
perceptualPrecision: perceptualPrecision,
file: file,
line: line
)
Expand Down Expand Up @@ -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
Expand All @@ -173,8 +165,7 @@ extension XCTestCase {
matching: viewController,
as: .image(
on: device.imageConfig,
precision: precision,
perceptualPrecision: perceptualPrecision,
subpixelThreshold: subpixelThreshold,
traits: traits
),
named: name,
Expand Down

0 comments on commit 0fc2fb8

Please sign in to comment.