forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-setup.ts
More file actions
29 lines (26 loc) · 876 Bytes
/
Copy pathtest-setup.ts
File metadata and controls
29 lines (26 loc) · 876 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
// Test setup file for Jest
import 'reflect-metadata';
// Mock console methods to reduce noise in tests
global.console = {
...console,
// Uncomment to ignore specific console methods during tests
// log: jest.fn(),
// debug: jest.fn(),
// info: jest.fn(),
// warn: jest.fn(),
// error: jest.fn(),
};
// Extend default timeout for integration tests that boot a full NestJS app.
// Individual specs can override with jest.setTimeout() as needed.
if (typeof jest !== 'undefined') {
const originalSetTimeout = jest.setTimeout.bind(jest);
jest.setTimeout = (timeout: number = 5000) => {
return originalSetTimeout(timeout);
};
}
/**
* Default Jest timeout for integration tests (ms).
* Integration suites that create a NestJS application typically need
* more than the default 5 s, especially in CI.
*/
export const INTEGRATION_TEST_TIMEOUT = 30_000;