-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add an env var to not to save images in record mode #69
base: main
Are you sure you want to change the base?
Add an env var to not to save images in record mode #69
Conversation
Just verify that the image is created but dont save images.
Burak Coskun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
@@ -103,7 +103,11 @@ - (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer | |||
error:(NSError **)errorPtr | |||
{ | |||
if (self.recordMode) { | |||
return [self _recordSnapshotOfViewOrLayer:viewOrLayer selector:selector identifier:identifier error:errorPtr]; | |||
if ([self _saveImagesInRecordMode]) { |
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.
We should also provide a way to set this via a property, via FBSnapshotTestCase
.
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.
then we can remove this one? just set it from there?
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.
I'm not sure it would work for our case, because we would want to set this outside of the testing code (i.e., via an env var set in the scheme), but if someone else wanted to use this it's good to give them options.
Add dontSaveImagesInRecordMode as a property to FBSnapshotTestCase and naturally to FBSnapshotTestController. In record mode, if this property set to NO then snapshot images are neither saved nor tested against reference images. They are just skipped
Just verify that the image is created but dont save images.