Files
AFFiNE-Mirror/blocksuite/integration-test/vitest.config.ts
doodlewind 2763b820ab chore(editor): add retry for flaky test (#12143)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Tests**
  - Updated integration test configuration to automatically retry failed tests up to 3 times in CI environments, improving test reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-07 02:01:14 +00:00

44 lines
1.1 KiB
TypeScript

import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import { defineConfig } from 'vitest/config';
export default defineConfig(_configEnv =>
defineConfig({
esbuild: { target: 'es2018' },
optimizeDeps: {
force: true,
esbuildOptions: {
// Vitest hardcodes the esbuild target to es2020,
// override it to es2022 for top level await.
target: 'es2022',
},
},
plugins: [vanillaExtractPlugin()],
test: {
include: ['src/__tests__/**/*.spec.ts'],
retry: process.env.CI === 'true' ? 3 : 0,
browser: {
enabled: true,
headless: process.env.CI === 'true',
instances: [{ browser: 'chromium' }],
provider: 'playwright',
isolate: false,
viewport: {
width: 1024,
height: 768,
},
},
coverage: {
provider: 'istanbul', // or 'c8'
reporter: ['lcov'],
reportsDirectory: '../../.coverage/integration-test',
},
deps: {
interopDefault: true,
},
testTransformMode: {
web: ['src/__tests__/**/*.spec.ts'],
},
},
})
);