forked from CISC375/Sage
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.ts
More file actions
39 lines (33 loc) · 930 Bytes
/
jest.setup.ts
File metadata and controls
39 lines (33 loc) · 930 Bytes
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
// jest.setup.ts
// Use relative path to avoid alias resolution issues in CI
jest.mock('./config.ts', () => ({
BOT: { NAME: 'TestBot' },
BOTMASTER_PERMS: [],
DB: {
COURSES: 'courses',
POLLS: 'polls',
USERS: 'users',
},
GUILDS: {
MAIN: 'dummy-guild-id'
},
ROLES: {
STAFF: 'dummy-staff-role-id',
ADMIN: 'dummy-admin-role-id',
MUTED: 'dummy-muted-role-id',
VERIFIED: 'dummy-verified-role-id',
},
EMAIL: {
SENDER: 'no-reply@example.com',
REPLY_TO: 'support@example.com',
},
}), { virtual: true });
jest.mock('parse-duration', () => ({
__esModule: true,
default: jest.fn((input: string) => {
if (/^\d+\s*m(s|in)?$/i.test(input)) return 60_000;
if (/^\d+\s*h$/i.test(input)) return 3_600_000;
if (/^\d+\s*s(ec)?$/i.test(input)) return 1_000;
return 1_000;
}),
}));