diff --git a/test/mock-react-native-iap.ts b/test/mock-react-native-iap.ts new file mode 100644 index 00000000..5cf978db --- /dev/null +++ b/test/mock-react-native-iap.ts @@ -0,0 +1,16 @@ +jest.mock("react-native-iap", () => { + const useIAP = (): Record => ({ + connected: true, + getProducts: jest.fn(), + getSubscriptions: jest.fn(), + products: [], + subscriptions: [], + }) + + const withIAPContext = jest.fn() + + return { + useIAP, + withIAPContext, + } +}) diff --git a/test/setup.ts b/test/setup.ts index f0d36404..97891c6e 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -6,6 +6,7 @@ import "./mock-async-storage" import "./mock-i18n" import "./mock-keychain" import "./mock-react-native-device-info" +import "./mock-react-native-iap" import "./mock-react-native-localize" import "./mock-reactotron" import "./mock-textinput"