Skip to content

Conversation

@johannesliespace
Copy link

Update the snapshot testing code to the latest changes of the source and adjust it to our usage

heckj and others added 30 commits May 5, 2022 17:05
* Add an optional perceptualPrecision parameter for image snapshot comparisons

The perceptual precision number is between 0 & 1 that gets translated to a CIE94 tolerance https://en.wikipedia.org/wiki/Color_difference

* Use CIColorThreshold and CIAreaAverage for a 70% faster image diff on iOS 14, tvOS 14, and macOS 11

* Add a unit test demonstrating the difference between pixel precision and perceptual precision

* Update the reference image for the image precision test

* Backport the threshold filter to macOS 10.13 by creating a CIImageProcessorKernel implementation

* Update Sources/SnapshotTesting/Snapshotting/UIImage.swift

* Update NSImage.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
* Modernize Project

Getting the project into some modern order before next release.

* Update ci.yml

* Update ci.yml

* wip

* wip

* wip

* Update ci.yml
* Require Swift 5.5+

* wip

* wip
* Add SnapshotTestingHEIC to plugins list

* Fix README
I think it's better to be conservative, as the list of variables that can cause discrepancies is incomplete and unlikely to ever be exhaustive.

Other things that seem to cause differences are the architecture of the Mac running the simulator causing subtle "sub" pixel differences, and optical font sizing adjustments that either don't respect the `displayScale` UI trait or deliberately ignore it because it's truly driven by the device display's points per inch (a product of the display's scale and pixels per inch).

I think a broad caution is more prudent than extending the warning to include more device characteristics, as even if that list could be complete now, it would be very hard to track.
GitHub recently updated their latest version, which doesn't support
Swift.
Co-authored-by: Stephen Celis <stephen@stephencelis.com>
Fixes pointfreeco#697.

With 1.10.0, a change bumped the platform requirements, but this is
hopefully not necessary.
stephencelis and others added 27 commits March 31, 2025 21:50
* Update README for Swift Testing

* Update README.md
* Swift Testing: Reset file counter for each test

This introduces a new task local to the test scoping trait to allow a
test to be repeatedly run.

Fixes pointfreeco#963.

* wip
* Add docs for UI testing.

* Update IntegratingWithTestFrameworks.md

---------

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
We made changes in pointfreeco#962 to fix an issue with main thread checking and
dispatch queues in `assertSnapshot`, but didn't apply the fix to a
similar situation in `assertInlineSnapshot`.
* Update package versioning

SPM recommends `Package.swift` point to the latest version, but we're
doing the opposite.

* Disable Android CI job in ci.yml

Comment out the Android CI job in the workflow file.

* Update ci.yml

* Fix test

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
#Conflicts:
#	Sources/SnapshotTesting/Snapshotting/UIImage.swift
@patrickniepel patrickniepel self-requested a review January 22, 2026 08:34
@patrickniepel patrickniepel merged commit a4f6d62 into main Jan 22, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.