Testing Tools Configuration¶
Vitest Configuration¶
vitest.config.ts
:
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./test-setup.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
threshold: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
}
}
});
Playwright Configuration¶
playwright.config.ts
:
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
timeout: 30 * 1000,
expect: {
timeout: 5000
},
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
actionTimeout: 0,
trace: 'on-first-retry',
}
});
Last Updated: 2024-12-22