Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ final class InAppPurchase2PluginTests: XCTestCase {
//TODO(louisehsu): Add testing for lower versions.
@available(iOS 17.0, macOS 14.0, *)
func testGetProductsWithStoreKitError() async throws {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
try XCTSkipIf(
// https://developer.apple.com/forums/thread/808030
osVersion.majorVersion == 26 && osVersion.minorVersion == 2,
"Known StoreKitTest bug on Xcode 26.2 with setSimulatedError() when used on .loadProducts API"
)
Comment on lines +184 to +189
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developer.apple.com/forums/thread/808030
.setSimulatedError doesnt work on specifically 26.2, but apples availability annotation doesnt support donut hole versioning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the URL into a comment somewhere? Definitely also in this PR description.


try await session.setSimulatedError(
.generic(.networkError(URLError(.badURL))), forAPI: .loadProducts)

Expand Down Expand Up @@ -217,6 +224,15 @@ final class InAppPurchase2PluginTests: XCTestCase {

@available(iOS 17.0, macOS 14.0, *)
func testFailedNetworkErrorPurchase() async throws {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
try XCTSkipIf(
// https://developer.apple.com/forums/thread/808030
osVersion.majorVersion == 26 && osVersion.minorVersion == 2,
"Known StoreKitTest bug on Xcode 26.2 with setSimulatedError() when used on .loadProducts API"
)

// StoreKitTest aggressively caches products and transaction, which means sometimes it bypasses a simulated error.
session.clearTransactions()
try await session.setSimulatedError(
.generic(.networkError(URLError(.badURL))), forAPI: .loadProducts)
let expectation = self.expectation(description: "products request should fail")
Expand Down Expand Up @@ -290,7 +306,7 @@ final class InAppPurchase2PluginTests: XCTestCase {
XCTFail("Purchase should NOT fail. Failed with \(error)")
}
}
await fulfillment(of: [expectation], timeout: 5)
await fulfillment(of: [expectation], timeout: 10)
}

func testDiscountedProductSuccess() async throws {
Expand All @@ -303,7 +319,7 @@ final class InAppPurchase2PluginTests: XCTestCase {
XCTFail("Purchase should NOT fail. Failed with \(error)")
}
}
await fulfillment(of: [expectation], timeout: 5)
await fulfillment(of: [expectation], timeout: 10)
}

func testPurchaseWithAppAccountToken() async throws {
Expand Down
Loading