import { defineConfig } from 'vitest/config';
import path from 'path';

export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './resources/js'),
    },
  },
  test: {
    globals: true,
    environment: 'jsdom',
    include: ['resources/js/**/*.test.{ts,tsx}'],
    setupFiles: ['./resources/js/test/setup.ts'],
    coverage: {
      reporter: ['text', 'json', 'html'],
      thresholds: {
        lines: 60,
        functions: 60,
        branches: 60,
        statements: 60,
        'resources/js/lib/**': {
          lines: 75,
          functions: 75,
          branches: 75,
          statements: 75,
        },
        'resources/js/hooks/**': {
          lines: 75,
          functions: 75,
          branches: 75,
          statements: 75,
        },
      },
    },
  },
});
