pointfreeco / swift-snapshot-testing

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

Include failure reason when snapshot comparisons fail #638

Closed ejensen closed 1 year ago

ejensen commented 1 year ago

A follow-up to https://github.com/pointfreeco/swift-snapshot-testing/pull/628#issuecomment-1250404163

This PR updates the image comparison methods to report a failure message rather than just a boolean of whether the comparison passed or failed. This failure message provides more insight into the reason why a snapshot assertion failed. This is especially helpful when the image differences are subtle - such as the "ghost" differences mentioned in https://github.com/pointfreeco/swift-snapshot-testing/pull/628#issuecomment-1250224235

Fancy logo Fancy logo