Skip to content

Commit

Permalink
🤡 Mock react-native-iap for passing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Nov 3, 2022
1 parent d326b2c commit 81298c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/mock-react-native-iap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
jest.mock("react-native-iap", () => {
const useIAP = (): Record<string, unknown> => ({
connected: true,
getProducts: jest.fn(),
getSubscriptions: jest.fn(),
products: [],
subscriptions: [],
})

const withIAPContext = jest.fn()

return {
useIAP,
withIAPContext,
}
})
1 change: 1 addition & 0 deletions test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 81298c2

Please sign in to comment.