diff --git a/apps/studio/vitest.config.ts b/apps/studio/vitest.config.ts index 4c64e6653ea..b0d1a68df0f 100644 --- a/apps/studio/vitest.config.ts +++ b/apps/studio/vitest.config.ts @@ -9,6 +9,8 @@ import { configDefaults, defineConfig } from 'vitest/config' // `setupFiles` live next to the test file itself. This forces them to always resolve correctly. const dirname = fileURLToPath(new URL('.', import.meta.url)) +const IS_CI = !!process.env.CI + export default defineConfig({ plugins: [ react(), @@ -24,6 +26,8 @@ export default defineConfig({ test: { globals: true, environment: 'jsdom', // TODO(kamil): This should be set per test via header in .tsx files only + // Retry flaky tests in CI only; failures locally should surface immediately. + retry: IS_CI ? 2 : 0, setupFiles: [ resolve(dirname, './tests/setup/polyfills.ts'), resolve(dirname, './tests/vitestSetup.ts'),