forked from hsjoberg/blixt-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjestSetup.js
51 lines (44 loc) · 2.92 KB
/
jestSetup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from "react";
jest.mock("react-native-camera", () => require("./mocks/react-native-camera"));
jest.mock("@react-native-community/async-storage", () => require("./mocks/@react-native-community/async-storage"));
jest.mock("react-native-sqlite-storage", () => require("./mocks/react-native-sqlite-storage"));
jest.mock("react-native-build-config", () => require("./mocks/react-native-build-config"));
jest.mock("react-native-push-notification", () => require("./mocks/react-native-push-notification"));
jest.mock("react-native-keychain", () => require("./mocks/react-native-keychain"));
jest.mock("react-native-securerandom", () => require("./mocks/react-native-securerandom"));
jest.mock("react-native-fingerprint-scanner", () => require("./mocks/react-native-fingerprint-scanner"));
jest.mock("@react-native-community/clipboard", () => require("./mocks/@react-native-community/clipboard"));
jest.mock("@react-native-community/masked-view", () => require("./mocks/@react-native-community/masked-view"));
jest.mock("@react-native-community/google-signin", () => require("./mocks/@react-native-community/google-signin"));
jest.mock("react-native-fs", () => require("./mocks/react-native-fs"));
jest.mock("react-native-document-picker", () => require("./mocks/react-native-document-picker"));
jest.mock("@react-native-community/geolocation", () => require("./mocks/@react-native-community/geolocation"));
jest.mock("react-native-permissions", () => require("./mocks/react-native-permissions"));
jest.mock("./src/lndmobile/index", () => require("./mocks/lndmobile/index"));
jest.mock("./src/lndmobile/wallet", () => require("./mocks/lndmobile/wallet"));
jest.mock("./src/lndmobile/channel", () => require("./mocks/lndmobile/channel"));
jest.mock("./src/lndmobile/onchain", () => require("./mocks/lndmobile/onchain"));
jest.mock("./src/lndmobile/autopilot", () => require("./mocks/lndmobile/autopilot"));
jest.mock("./src/lndmobile/scheduled-sync", () => require("./mocks/lndmobile/scheduled-sync"));
jest.mock("./src/utils/constants.ts", () => require("./mocks/utils/constants"));
const ReactNative = require("react-native");
ReactNative.NativeModules.LndMobile = {};
ReactNative.NativeModules.LndMobileTools = {};
ReactNative.NativeModules.LndMobileTools.log = jest.fn();
ReactNative.UIManager.configureNext = jest.fn();
ReactNative.UIManager.configureNextLayoutAnimation = jest.fn();
ReactNative.InteractionManager.runAfterInteractions = ((cb) => {
cb && cb();
});
ReactNative.Linking.addListener = jest.fn();
const NativeBase = require("native-base");
NativeBase.Toast.show = jest.fn();
NativeBase.Root = ({ children }) => (<>{children}</>);
import 'react-native-gesture-handler/jestSetup';
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
// The mock for `call` immediately calls the callback which is incorrect
// So we override it with a no-op
Reanimated.default.call = () => {};
return Reanimated;
});