Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes running iOS 13/14 tests with Xcode 14 by removing the direct dependency on the
SnapshotPreviews
package and instead depending on it through aSnapshotTestingStub
package.Why is SnapshotTestingStub needed?
At the time of the writing, we still support iOS 13 and iOS 14, which need macOS 12 to run tests in the simulator.
CircleCI bundles Xcode 14.2 with the macOS 12 image, which comes with Swift 5.7.
Emerge's SnapshotPreviews package currently has a dependency on the https://github.com/swhitty/FlyingFox package version 0.16 which requires Swift 5.8.
When we open Revenuecat.xcodeproj in Xcode 14.2, it tries to pull all dependencies, including SnapshotPreviews, and fails to build because of the FlyingFox dependency.
This prevents us from running tests in the iOS 13 and iOS 14 simulators.
It is not possible to add a package to an Xcode project conditionally on the Swift version used, but we can create a stub package that only depends on SnapshotPreviews,
and only pulls the dependency for Swift 5.8.