import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
  plugins: [react()],
  test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: ['./tests/setup.ts'],
    include: ['tests/**/*.test.ts', 'tests/**/*.test.tsx'],
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html'],
      reportsDirectory: './coverage',
      include: ['src/**/*.ts', 'desktop/src/**/*.ts', 'desktop/src/**/*.tsx'],
      exclude: [
        'src/**/*.d.ts',
        'desktop/src/**/*.d.ts',
        'tests/**',
        '**/*.test.ts',
        '**/*.test.tsx',
        '**/node_modules/**',
      ],
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './desktop/src'),
      '@lib': path.resolve(__dirname, './desktop/src/lib'),
    },
  },
});
