pointfreeco / swift-snapshot-testing

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

Ability to remove inline snapshots #844

Closed stephencelis closed 3 months ago

stephencelis commented 3 months ago

This updates assertInlineSnapshot to match against an optional, so that when nil is provided, the snapshot helper can scrub the trailing snapshot closure.

This can be used by downstream helpers, like assertMacro to "un-record" certain snapshots when it makes sense to: e.g. when removing an expansion and recording a new diagnostic instead.