mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
<!-- 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 -->
44 lines
1.1 KiB
TypeScript
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'],
|
|
},
|
|
},
|
|
})
|
|
);
|