Files
purchases-ios/Sources/LocalReceiptParsing/BasicTypes
NachoSoto c4cfdb19e2 StoreKitIntegrationTests: print AppleReceipt data whenever verifyEntitlementWentThrough fails (#1929)
This will help us debug flaky tests.

Example:
> INFO: 😻💰 Purchased product -
'com.revenuecat.monthly_4.99.1_week_intro'
DEBUG: ℹ️ Force refreshing the receipt to get latest transactions from
Apple.
DEBUG: ℹ️ Loaded receipt from url
file:///Users/nachosoto/Library/Developer/CoreSimulator/Devices/A3576DC2-355E-45BA-B32C-D2C0A3811BB4/data/Containers/Data/Application/EDF3B7C8-A4BD-4629-813E-0934528AF02E/StoreKit/receipt
INFO: ℹ️ Receipt parsed successfully
INFO: ℹ️ Receipt content:
["inAppPurchases": [], "creationDate": 2022-09-21 21:00:07 +0000,
"opaqueValue": 8 bytes, "applicationVersion": "1",
"originalApplicationVersion": "<unknown>", "bundleId":
"com.revenuecat.StoreKitTestApp", "expirationDate": 4001-01-01 00:00:00
+0000, "sha1Hash": 20 bytes]

/Users/nachosoto/dev/purchases-ios/Tests/BackendIntegrationTests/StoreKitIntegrationTests.swift:64:
error: -[BackendIntegrationTests.StoreKit2IntegrationTests
testCanPurchaseProduct] : failed - Expected Entitlement. Got: [:]
expected to have Dictionary<String, EntitlementInfo> with count 1, got 0
Actual Value: [:]

I've also added the receipt as a test attachment so we can download it
from `CircleCI`:

![Screenshot 2022-09-21 at 14 33
01](https://user-images.githubusercontent.com/685609/191614494-c1b1b24e-133d-45f2-83b5-f4cd1f491294.png)
2022-09-21 14:56:14 -07:00
..