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

export default defineConfig({
  test: {
    globals: true,
    environment: 'node',
    setupFiles: ['./test/setup.ts'],
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html'],
      exclude: [
        'node_modules/',
        'dist/',
        'test/',
        '**/*.d.ts',
        '**/*.config.ts',
        'tools/cli/index.ts', // CLI tool
      ],
      thresholds: {
        global: {
          branches: 80,
          functions: 80,
          lines: 80,
          statements: 80
        }
      }
    },
    testTimeout: 30000, // 30 seconds for complex fixture generation
    hookTimeout: 10000, // 10 seconds for setup/teardown
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, './core'),
      '@generators': resolve(__dirname, './core/generators'),
      '@schemas': resolve(__dirname, './core/schemas'),
      '@utils': resolve(__dirname, './core/utils'),
      '@services': resolve(__dirname, './services'),
      '@scenarios': resolve(__dirname, './scenarios'),
      '@environments': resolve(__dirname, './environments'),
    },
  },
})