-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.ts
45 lines (40 loc) · 1.09 KB
/
jest.setup.ts
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
import '@testing-library/jest-dom'
import { Amplify } from 'aws-amplify'
import outputs from './amplify_outputs.json'
beforeEach(() => {
Amplify.configure(outputs)
})
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (str: string) => str,
i18n: {
changeLanguage: Promise.resolve({})
}
})
}))
jest.mock('aws-amplify/auth', () => ({
fetchAuthSession: () => ({
userSub: '77463cae-8fcd-48c8-a526-a8997a4e167e',
tokens: {
accessToken: {
'custom:orgId': '1cf1a2b2-30dd-43ea-b854-e6217073fe06'
}
}
}),
signUp: () => ({
userId: 'newUserId'
}),
signOut: jest.fn()
}))
jest.mock('@/hooks/useDeviceLocation')
jest.mock('@/store/AddressStore')
jest.mock('@/store/ApiStore')
jest.mock('@/store/BusStore')
jest.mock('@/store/ExceptionStore')
jest.mock('@/store/OrgStore')
jest.mock('@/store/RiderStore')
jest.mock('@/store/RouteActionStore')
jest.mock('@/store/RouteStore')
jest.mock('@/store/SchoolStore')
jest.mock('@/store/StopStore')
jest.mock('@/store/UserStore')