generated from CaenCamp/project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.setup.js
38 lines (33 loc) · 999 Bytes
/
jest.setup.js
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
import '@testing-library/jest-dom/extend-expect';
// eslint-disable-next-line no-console
const originalError = console.error;
// eslint-disable-next-line no-console
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return;
}
originalError.call(console, ...args);
};
jest.mock('next/image', () => ({
__esModule: true,
default: () => {
return 'Next image stub'; // whatever
},
}));
// // eslint-disable-next-line no-console
// const originalError = console.error;
// // eslint-disable-next-line no-undef
// beforeAll(() => {
// // eslint-disable-next-line no-console
// console.error = (...args) => {
// if (/Warning.*not wrapped in act/.test(args[0])) {
// return;
// }
// originalError.call(console, ...args);
// };
// });
// // eslint-disable-next-line no-undef
// afterAll(() => {
// // eslint-disable-next-line no-console
// console.error = originalError;
// });