-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update #Preview
macro generated test to use snapshotDevices
.
#73
base: main
Are you sure you want to change the base?
Conversation
} else { | ||
// Ensure we call on the test looping devices: | ||
assertionStatement = """ | ||
assertSnapshots(matching: preview(), testName: "\(rawPreviewModel.displayName)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function defines as:
private func assertSnapshots(matching preview: _Preview, testName: String = #function) {
https://github.com/BarredEwe/Prefire/blob/main/Templates/PreviewTests.stencil#L60
Hi, thanks for the fix and finding the problem) To try this fix call the |
had to install 5.8.0 swift tools version: swiftenv local 5.8.0 |
Think it's more complicated than this change. Seems we may need to update the
|
Maybe we need to create a model in order to pass the the |
Short description 📝
When using
#Preview
macro to generate snapshot tests in combination with test configuration with multiplesnapshot_devices
:The appropriate snapshot function is not called.
Resolution
Updates the
PreviewLoader
extension to ensure compatibility with a template-generated function that loops through different devices for snapshot testing.