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

export default defineConfig({
  test: {
    globals: true,
    environment: 'node',
    include: ['src/**/*.spec.ts'],
    exclude: ['src/**/*.integration.spec.ts', 'node_modules'],
    env: {
      BCRYPT_ROUNDS: '4',
    },
    coverage: {
      provider: 'v8',
      reporter: ['text', 'text-summary', 'json-summary', 'lcov', 'clover'],
      reportsDirectory: './coverage',
      include: ['src/modules/**/*.ts'],
      exclude: [
        'src/**/*.spec.ts',
        'src/**/*.integration.spec.ts',
        'src/**/*.mock.ts',
        'src/**/*.module.ts',
        'src/**/index.ts',
        'src/**/__tests__/**',
        'src/**/__mocks__/**',
        'src/**/dto/**',
        'node_modules',
      ],
      thresholds: {
        statements: 60,
        branches: 50,
        functions: 60,
        lines: 60,
      },
    },
  },
  resolve: {
    alias: {
      '@modules': path.resolve(__dirname, 'src/modules'),
    },
  },
});
