pointfreeco / swift-snapshot-testing

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

Add option to disable counter suffixes #747

Open dafurman opened 1 year ago

dafurman commented 1 year ago

This addresses the issue here: https://github.com/pointfreeco/swift-snapshot-testing/issues/429

This allows users to disable the default behavior of snapshot creation, where a counter is added whenever a test doesn't specify a test name.

For tests that only validate one snapshot, adding a suffix to these tests seems excessive. For me, this would result in most test files looking like MyViewControllerSnapshotTests/testLayout.1.png and it would be nice to be able to disable this functionality when it's not desired to keep file names simpler: MyViewControllerSnapshotTests/testLayout.png

Note: This recreates https://github.com/pointfreeco/swift-snapshot-testing/pull/486 after the initial fork was deleted.