-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestSetup.js
More file actions
39 lines (35 loc) · 1.17 KB
/
testSetup.js
File metadata and controls
39 lines (35 loc) · 1.17 KB
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
import Enzyme, { shallow, render, mount } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import renderer from "react-test-renderer";
// React 16 Enzyme adapter
Enzyme.configure({ adapter: new Adapter() });
jest.mock("react-native-permissions");
jest.mock("react-native-code-push");
jest.mock("react-native-firebase");
jest.mock("react-native-sentry");
jest.mock("react-native-iphone-x-helper");
jest.mock("react-native-touch-id");
jest.mock("react-native-haptic-feedback");
jest.mock("react-native-keychain");
jest.mock("react-native-randombytes");
jest.mock("react-native-qrcode-scanner");
jest.mock("react-native-shimmer");
jest.mock("react-native-svg");
jest.mock("react-native-interactable");
jest.mock("react-native-svg/lib/extract/extractBrush", value => {
return "";
});
jest.mock("react-native-contacts");
jest.mock("lottie-react-native");
if (typeof window !== "object") {
global.window = global;
global.window.navigator = {};
}
global.XMLHttpRequest = class XMLHttpRequest {
constructor() {}
};
// Make Enzyme functions available in all test files without importing
global.shallow = shallow;
global.render = render;
global.mount = mount;
global.renderer = renderer;