-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
42 lines (40 loc) 路 1.1 KB
/
Copy pathjest.setup.js
File metadata and controls
42 lines (40 loc) 路 1.1 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
import "@testing-library/jest-dom";
// Mock Supabase client
jest.mock("@/lib/supabase/server", () => ({
createClient: jest.fn(() => ({
auth: {
getUser: jest.fn(),
signUp: jest.fn(),
signInWithPassword: jest.fn(),
signOut: jest.fn(),
},
from: jest.fn(() => ({
select: jest.fn().mockReturnThis(),
insert: jest.fn().mockReturnThis(),
update: jest.fn().mockReturnThis(),
delete: jest.fn().mockReturnThis(),
eq: jest.fn().mockReturnThis(),
single: jest.fn(),
order: jest.fn().mockReturnThis(),
})),
})),
}));
jest.mock("@/lib/supabase/client", () => ({
createClient: jest.fn(() => ({
auth: {
getUser: jest.fn(),
signUp: jest.fn(),
signInWithPassword: jest.fn(),
signOut: jest.fn(),
},
from: jest.fn(() => ({
select: jest.fn().mockReturnThis(),
insert: jest.fn().mockReturnThis(),
update: jest.fn().mockReturnThis(),
delete: jest.fn().mockReturnThis(),
eq: jest.fn().mockReturnThis(),
single: jest.fn(),
order: jest.fn().mockReturnThis(),
})),
})),
}));