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

Write to snapshot state before failing #787

Closed stephencelis closed 10 months ago

stephencelis commented 10 months ago

XCTest test cases can be configured with continueAfterFailure = false, and in fact UI tests are configured with this by default, but in these cases inline snapshots will never be written because the failure aborts the test before we write to the snapshot state.

This commit reorders things to fix the problem.