Introducing SnapshotTestingMacros #974
adammcarter
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introducing SnapshotTestingMacros
I've been working on a swift macro library to generate snapshot tests in a format and structure similar to Swift Testing.
Instead of
@Suite
and@Test
you use@SnapshotSuite
and@SnapshotTest
.View more (including documentation) here: https://github.com/adammcarter/swift-snapshot-testing-macros
Create snapshots like this
Traits
Specify device sizes, theme (dark/light mode), background colours, padding and even force record and set snapshot strategies.
Traits can also be set on the suite so all tests inherit them.
And sensible defaults exist, such as automatically creating light and dark mode snapshot variants.
Parameterisation
configurations
Folder structure:
configurationValues
Folder structure:
And more
See the documentation on the README of the repo for a more comprehensive list of things you can do and example code.
Feedback
It's still in development but it would be great to get some early feedback from people who are interested in using this and fixing up any issues, adding new features or just discussing any technical sides of this macro.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions