RevenueCat Capacitor IAP; keep Stripe on web (#100) #102

Merged
westfarn merged 3 commits from feature/revenuecat-iap-100 into master 2026-08-04 03:43:10 -07:00
Showing only changes of commit 86bdb78de7 - Show all commits
+13
View File
@@ -3,3 +3,16 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
// Capacitor plugin ships ESM; Jest cannot parse it when AccountContext
// (or pages that import it) pull in utils/revenueCat. Stub globally.
jest.mock('@revenuecat/purchases-capacitor', () => ({
Purchases: {
configure: jest.fn(() => Promise.resolve()),
logIn: jest.fn(() => Promise.resolve({ customerInfo: {} })),
logOut: jest.fn(() => Promise.resolve({ customerInfo: {} })),
getOfferings: jest.fn(() => Promise.resolve({ current: null, all: {} })),
purchasePackage: jest.fn(() => Promise.resolve({ customerInfo: {} })),
restorePurchases: jest.fn(() => Promise.resolve({ customerInfo: {} })),
},
}));