Closed luispadron closed 4 months ago
The module AccessibilitySnapshot uses swift-snapshot-testing and the FBSnapshotTestCase_Accessibility* modules use iOSSnapshotTestCase.
I think I'd rather be explicit about this (AccessibilitySnapshot_iOSSnapshotTestCase
and AccessibilitySnapshot_SnapshotTesting
) than assume the primary framework uses SnapshotTesting
. The only reason the Package.swift defaults that way is iOSSnapshotTestCase didn't have SPM support when it was written. But seeing how things are going, I don't want to assume we'll stick with any particular snapshot engine for the long term. Eventually we may pull the snapshot comparison logic internally and only provide the SnapshotTesting
integration as a convenience to use their method names.
Ah that's fair, I was copying the Package setup but we can make this explicit on the impl used.
@NickEntin I updated this to move the BUILD.bazel
into the individual directories so its more explicit.
Bazel users can depend on either //Sources/Accessibility/SnapshotTesting/...
targets or //Sources/Accessibility/iOSSnapshotTestCase/...
targets. They would import it using the same module name import AccessibilitySnapshot
(let me know if we instead prefer this import name to also be explicit, I assumed users wouldn't use both implementations in the same target)
Also updated the README with Bazel instructions
Refactors the Bazel support to better match the Package.swift structure:
AccessibilitySnapshot_SnapshotTesting
usesswift-snapshot-testing
and theAccessibilitySnapshot_iOSSnapshotTestCase
modules useiOSSnapshotTestCase
.swift-snapshot-testing
to allow it to build with Bazel. I opted for this vs. registry because it's a simple BUILD files.includes
so downstream targets can include the AccessibilitySnapshot headers via#import <>
.