swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

Expose `snapshotDirectory` parameter in `assertSnapshot` methods

Open fespinoza opened this issue 10 months ago • 0 comments

I'm aware of the intention of the publicly available verifySnapshot method that exposes this parameter, but as consumers of the library we tend to use assertSnapshot instead.

assertSnapshot implementation has a very straightforward implementation that internally uses verifySnapshot, but now custom implementations also need to be aware if the custom method is used on a XCTest or SwiftTesting context.

This library already handles that variation, then simply exposing this parameter doesn't break the API and makes sure consumers keep the correct behavior of assertSnapshots in context where we need to modify the snapshotDirectory, like in Xcode Cloud.

fespinoza avatar Dec 19 '24 09:12 fespinoza