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

export default defineConfig({
  test: {
    globals: true,
    environment: 'node',
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html', 'lcov'],
      exclude: [
        'node_modules/',
        'dist/',
        'build/',
        '*.config.*',
        '**/*.d.ts',
        '**/*.test.*',
        '**/*.spec.*',
      ],
    },
    include: ['**/*.{test,spec}.{js,ts,tsx}'],
    exclude: ['node_modules', 'dist', 'build', '.next'],
  },
  resolve: {
    alias: {
      '@the-order/ui': resolve(__dirname, './packages/ui/src'),
      '@the-order/schemas': resolve(__dirname, './packages/schemas/src'),
      '@the-order/auth': resolve(__dirname, './packages/auth/src'),
      '@the-order/storage': resolve(__dirname, './packages/storage/src'),
      '@the-order/crypto': resolve(__dirname, './packages/crypto/src'),
      '@the-order/workflows': resolve(__dirname, './packages/workflows/src'),
      '@the-order/test-utils': resolve(__dirname, './packages/test-utils/src'),
    },
  },
});

