-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathjest.setup.ts
More file actions
33 lines (28 loc) · 759 Bytes
/
jest.setup.ts
File metadata and controls
33 lines (28 loc) · 759 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
// Optional: configure or set up a testing framework before each test.
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`
// Used for __tests__/testing-library.js
// Learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
jest.setTimeout(300000); // in milliseconds
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (str: string) => str,
}),
}));
jest.mock('next/router', () => ({
useRouter() {
return {
route: '/',
pathname: '',
query: '',
asPath: '',
push: jest.fn(),
events: {
on: jest.fn(),
off: jest.fn(),
},
beforePopState: jest.fn(),
prefetch: jest.fn(),
};
},
}));