Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

burakcoskun
Copy link

Just verify that the image is created but dont save images.

Just verify that the image is created but dont save images.
@CLAassistant
Copy link

CLAassistant commented Jan 24, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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]) {
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants