29 lines
921 B
JavaScript
29 lines
921 B
JavaScript
const stableUseIapResult = {
|
|
connected: false,
|
|
products: [],
|
|
subscriptions: [],
|
|
availablePurchases: [],
|
|
activeSubscriptions: [],
|
|
fetchProducts: jest.fn(async () => undefined),
|
|
requestPurchase: jest.fn(async () => undefined),
|
|
restorePurchases: jest.fn(async () => undefined),
|
|
reconnect: jest.fn(async () => false),
|
|
finishTransaction: jest.fn(async () => undefined),
|
|
getAvailablePurchases: jest.fn(async () => undefined),
|
|
getActiveSubscriptions: jest.fn(async () => []),
|
|
hasActiveSubscriptions: jest.fn(async () => false),
|
|
}
|
|
|
|
const getAvailablePurchases = jest.fn(async () => [])
|
|
|
|
module.exports = {
|
|
ErrorCode: {
|
|
UserCancelled: 'user-cancelled',
|
|
Pending: 'pending',
|
|
DeferredPayment: 'deferred-payment',
|
|
},
|
|
deepLinkToSubscriptions: jest.fn(async () => undefined),
|
|
getAvailablePurchases,
|
|
useIAP: jest.fn(() => stableUseIapResult),
|
|
__stableUseIapResult: stableUseIapResult,
|
|
}
|