-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.ts
More file actions
49 lines (44 loc) · 1.07 KB
/
setup.ts
File metadata and controls
49 lines (44 loc) · 1.07 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
40
41
42
43
44
45
46
47
48
49
import "@testing-library/jest-native/extend-expect";
// Mock AsyncStorage
jest.mock("@react-native-async-storage/async-storage", () => ({
setItem: jest.fn(() => Promise.resolve()),
getItem: jest.fn(() => Promise.resolve(null)),
removeItem: jest.fn(() => Promise.resolve()),
}));
// Mock Firebase
jest.mock("./app/config/firebase", () => ({
auth: {
signInWithEmailAndPassword: jest.fn(),
createUserWithEmailAndPassword: jest.fn(),
signOut: jest.fn(),
onAuthStateChanged: jest.fn(),
currentUser: null,
},
db: {
collection: jest.fn(),
doc: jest.fn(),
},
}));
// Mock expo-router
jest.mock("expo-router", () => ({
router: {
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
},
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
Tabs: ({ children }) => children,
Screen: () => null,
}));
// Mock Ionicons
jest.mock("@expo/vector-icons", () => ({
Ionicons: "Ionicons",
}));
// Mock LinearGradient
jest.mock("expo-linear-gradient", () => ({
LinearGradient: "LinearGradient",
}));