From 33e09c1f525edf4c8eed4f736a1f4d82b57ff63a Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 14 Jul 2025 22:00:26 -0400 Subject: [PATCH] chore: Update Jest configuration and test setup for improved timeout handling - Added a global test timeout of 30 seconds in jest.config.js. - Configured jest.setTimeout in jestSetup.js to allow individual test overrides if needed. - Enhanced test reliability by ensuring consistent timeout settings across all tests. --- api/jest.config.js | 1 + api/test/jestSetup.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/api/jest.config.js b/api/jest.config.js index 7169e82259..fd8bd31bd9 100644 --- a/api/jest.config.js +++ b/api/jest.config.js @@ -3,6 +3,7 @@ module.exports = { clearMocks: true, roots: [''], coverageDirectory: 'coverage', + testTimeout: 30000, // 30 seconds timeout for all tests setupFiles: [ './test/jestSetup.js', './test/__mocks__/logger.js', diff --git a/api/test/jestSetup.js b/api/test/jestSetup.js index ed92afd214..71ccaa86d2 100644 --- a/api/test/jestSetup.js +++ b/api/test/jestSetup.js @@ -10,3 +10,8 @@ process.env.JWT_SECRET = 'test'; process.env.JWT_REFRESH_SECRET = 'test'; process.env.CREDS_KEY = 'test'; process.env.CREDS_IV = 'test'; +process.env.ALLOW_EMAIL_LOGIN = 'true'; + +// Set global test timeout to 30 seconds +// This can be overridden in individual tests if needed +jest.setTimeout(30000);