forked from DogStark/PetChain-MobileApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
26 lines (23 loc) · 690 Bytes
/
Copy pathjest.setup.js
File metadata and controls
26 lines (23 loc) · 690 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
// Jest setup file for global test configuration
process.env.NODE_ENV = 'test';
process.env.STELLAR_NETWORK = 'testnet';
process.env.JWT_SECRET = 'test-secret-key';
// Suppress console errors in tests unless explicitly needed
const originalError = console.error;
beforeAll(() => {
console.error = (...args) => {
if (
typeof args[0] === 'string' &&
(args[0].includes('Warning: ReactDOM.render') ||
args[0].includes('Not implemented: HTMLFormElement.prototype.submit'))
) {
return;
}
originalError.call(console, ...args);
};
});
afterAll(() => {
console.error = originalError;
});
// Mock timers for consistent testing
jest.useFakeTimers();