Make the placement of the snapshot directory configurable via a single entry point #654
saren-tech
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My problem
I have a project with around ~100 modules, many of these modules have a test target that takes snapshots.
These tests are in folders eg:
root/logic/ManagerSpec.swift
Which results in the snapshots being recorded in
root/logic/__snapshots__/ManagerSpec/.....png
If these files are not ignored Xcode generates warnings like
However excluding every nested snapshot directory is a lot of 'effort' and if for some reason test are removed, renamed, moved then you also have to update the package file which is additional manual labor.
Since the package file does not seem to support pattern matching like cocoapods we sadly cannot do
(or please correct me if I am wrong).
Solutions?
So my question would be does anyone here have a nice solution for this?
Some ideas of mine
root/__snapshots__/[all files]
__snapshots__
in between like:root/__snapshots__/logic/ManagerSpec/...
Changing this in the library would break current tests so if something like this would be implemented (would still prefer a pattern ignore) we could introduce a enum like
SnapshotDirectoryStrategy
and have it configurable likepublic var isRecording = false
The enum could then be something like
Beta Was this translation helpful? Give feedback.
All reactions