Roo-Code/webview-ui/vitest.config.ts
Roo Code ebadc1c76c fix: add timeout configurations to prevent flaky tests in CI
- Add explicit test timeout (15s), hook timeout (10s), and teardown timeout (10s) to vitest config
- Configure retry logic for CI environments to handle occasional flaky tests
- Add asyncUtilTimeout configuration to testing library to fail faster
- Resolves issue where tests would hang indefinitely in CI showing dots continuously

Fixes the flaky test issue reported in GitHub Actions run 16625858640
2025-07-30 15:35:46 +00:00

27 lines
814 B
TypeScript

import { defineConfig } from "vitest/config"
import path from "path"
export default defineConfig({
test: {
globals: true,
setupFiles: ["./vitest.setup.ts"],
watch: false,
reporters: ["dot"],
silent: true,
environment: "jsdom",
include: ["src/**/*.spec.ts", "src/**/*.spec.tsx"],
// Add timeout configurations to prevent flaky tests in CI
testTimeout: 15000, // 15 seconds for individual tests (increased from default 5s)
hookTimeout: 10000, // 10 seconds for setup/teardown hooks
teardownTimeout: 10000, // 10 seconds for teardown
// Retry flaky tests once in CI environments
retry: process.env.CI ? 1 : 0,
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@src": path.resolve(__dirname, "./src"),
"@roo": path.resolve(__dirname, "../src/shared"),
},
},
})