| 1 | // Set environment variables for testing |
| 2 | process.env.NODE_ENV = "test"; |
| 3 | |
| 4 | // Load environment variables from .env.test |
| 5 | require("dotenv").config({ path: ".env.test" }); |
| 6 | |
| 7 | // Increase the default timeout for all tests |
| 8 | jest.setTimeout(30000); |
| 9 | |
| 10 | // Mock console methods to reduce noise during tests |
| 11 | if (process.env.JEST_SILENT) { |
| 12 | console.log = jest.fn(); |
| 13 | console.info = jest.fn(); |
| 14 | console.warn = jest.fn(); |
| 15 | console.error = jest.fn(); |
| 16 | } |
| 17 | |
| 18 | // Add any global setup/teardown code here |