pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.72k stars 565 forks source link

Updated interface #762

Closed stephencelis closed 11 months ago

stephencelis commented 11 months ago

Let's introduce a more streamlined version of assertSnapshot that takes an of instead of a matching parameter:

-assertSnapshot(matching: value, as: .json)
+assertSnapshot(of: value, as: .json)

While matching read OK, it is also a little confusing, since it sounds like the value itself is a snapshot, but the helper is really taking a snapshot of the value to be compared.

We'll keep the old version around for a long time as a soft deprecation, but whenever we get close to realizing a 2.0 we can make a harder break.