Open ton252 opened 2 years ago
I don't know why, but the problem is in this lines:
public var diff: (Value, Value) -> (String, [XCTAttachment])?
public typealias SnapshotTestCase = XCTestCase
init(
toData: @escaping (_ value: Value) -> Data,
fromData: @escaping (_ data: Data) -> Value,
diff: @escaping (_ lhs: Value, _ rhs: Value) -> (String, [XCTAttachment])?
The same thing is here: https://github.com/Quick/Quick/issues/961
@ton252 did you find any solution to this?
@mariusfanu The only solution (dirty) that I found is to hide any public declaration of XCTestCase XCTAttachment. For example change XCTAttachment to Any and check type inside function (I know this is a dirty way)
Yes, that's not ideal, thanks for the response
I solved this by using swift-create-framework tool and this xcodebuild argument (ENABLE_TESTING_SEARCH_PATHS):
swift create-xcframework --package-path . --stack-evolution --configuration debug --output xcframeworks-debug --platform ios --xc-setting ENABLE_TESTING_SEARCH_PATHS=YES
@osrufung Using ENABLE_TESTING_SEARCH_PATHS=YES allowed me to generate an xcframework but when added in test target i am getting similar error.
'XCTAttachment' is not a member type of class 'XCTest.XCTest'
Any idea?
In our team we have no opportunity to import swift-snapshot-testing using GitHub. And we decided to build a binary version of xcframework and put it inside project. But when we upgraded Xcode to 13 version it stoped working.
We set property Build for distribution = YES in project. Here is a script, that we use to build xcframework:
and this is an error message: