Some checks failed
CI / Lint & Type Check (push) Failing after 56s
CI / Tests (push) Successful in 1m14s
CI / Build Web (push) Has been skipped
CI / Security Scan (push) Successful in 45s
CI / Build Electron (Linux) (push) Has been skipped
CI / Build Tauri (ubuntu-latest) (push) Has been skipped
CI / Build Electron (Windows) (push) Has been cancelled
CI / Build Tauri (windows-latest) (push) Has been cancelled
82 lines
1.6 KiB
TypeScript
82 lines
1.6 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
// Test environment
|
|
environment: 'jsdom',
|
|
|
|
// Setup files
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
|
|
|
// Global test configuration
|
|
globals: true,
|
|
|
|
// Include patterns
|
|
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
|
|
|
// Exclude patterns
|
|
exclude: [
|
|
'node_modules',
|
|
'dist',
|
|
'dist-electron',
|
|
'android',
|
|
'ios',
|
|
'server',
|
|
'src-tauri',
|
|
],
|
|
|
|
// Coverage configuration
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
reportsDirectory: './coverage',
|
|
exclude: [
|
|
'node_modules/',
|
|
'src/__tests__/',
|
|
'**/*.d.ts',
|
|
'**/*.test.{ts,tsx}',
|
|
'**/*.spec.{ts,tsx}',
|
|
'src/main.tsx',
|
|
'src/vite-env.d.ts',
|
|
],
|
|
// Coverage thresholds
|
|
thresholds: {
|
|
global: {
|
|
branches: 50,
|
|
functions: 50,
|
|
lines: 50,
|
|
statements: 50,
|
|
},
|
|
},
|
|
},
|
|
|
|
// Reporter configuration
|
|
reporters: ['default', 'html'],
|
|
|
|
// Watch configuration
|
|
watch: false,
|
|
|
|
// Clear mocks between tests
|
|
clearMocks: true,
|
|
|
|
// Restore mocks after each test
|
|
restoreMocks: true,
|
|
|
|
// Timeout for tests
|
|
testTimeout: 10000,
|
|
|
|
// Hooks timeout
|
|
hookTimeout: 10000,
|
|
},
|
|
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
});
|
|
|