-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathjestsetup.js
More file actions
30 lines (26 loc) · 821 Bytes
/
Copy pathjestsetup.js
File metadata and controls
30 lines (26 loc) · 821 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
import '@testing-library/jest-dom';
require('jest-fetch-mock').enableMocks();
// Polyfill for TextEncoder/TextDecoder in Node.js environment
const { TextEncoder, TextDecoder } = require('util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
// Mock IntersectionObserver for jsdom
global.IntersectionObserver = class IntersectionObserver {
constructor(callback) {
this.callback = callback;
}
observe() { return null; }
unobserve() { return null; }
disconnect() { return null; }
};
// Mock ResizeObserver for jsdom
global.ResizeObserver = class ResizeObserver {
constructor(callback) {
this.callback = callback;
}
observe() { return null; }
unobserve() { return null; }
disconnect() { return null; }
};
// Suppress Mongoose Jest warnings
process.env.SUPPRESS_JEST_WARNINGS = 'true';