diff --git a/src/tests/setup/integration-global-setup.ts b/src/tests/setup/integration-global-setup.ts index d4ae6413..4a8e40b4 100644 --- a/src/tests/setup/integration-global-setup.ts +++ b/src/tests/setup/integration-global-setup.ts @@ -43,7 +43,8 @@ export async function setup() { if (!response.ok) return false; const text = await response.text(); return text === 'pong'; - } catch (error) { + } catch (e) { + logger.debug('Ping failed while waiting for server, this is expected.', { error: e }); return false; } }; diff --git a/vitest.config.integration.ts b/vitest.config.integration.ts index 84dadc70..ac3260f8 100644 --- a/vitest.config.integration.ts +++ b/vitest.config.integration.ts @@ -15,6 +15,10 @@ export default mergeConfig(viteConfig, defineConfig({ // The path must be specific. By default, Vitest doesn't look in `src` // unless the pattern explicitly includes it. include: ['src/**/*.integration.test.ts'], + // CRITICAL: We must override the `exclude` property from the base vite.config.ts. + // Otherwise, the inherited `exclude` rule will prevent any integration tests from running. + // Setting it to an empty array removes all exclusion rules for this project. + exclude: [], // This setup script starts the backend server before tests run. globalSetup: './src/tests/setup/integration-global-setup.ts', testTimeout: 15000, // Increased timeout for server startup and API calls.