pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.

Home Page:https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run snapshot test directly in Swift Package Manager (SPM) containing SwiftUI views

XRadevFRT opened this issue · comments

commented

Greetings everyone!
The title pretty much says it all. Im currently exporting the UI in a SwiftPM and because there are already XCTest I was wondering if there is a way to directly snapshot the UI in the package...

You can set up and run the tests from your package.

You can take a look here:

https://github.com/criticalmaps/criticalmaps-ios/tree/main/CriticalMapsKit/Tests/StyleguideTests

commented

@mltbnz

Thank You! By chance, I managed to make them work. But still, your answer is beneficial to me.

One thing I couldn't do, however, is to generate images for the failing tests...
Help will be much appreciated! 🍻

I think I don't know what you referring to.
If you mean the failure screenshot when a test fails you will see them in Xcode

image