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

export default defineConfig({
  esbuild: {
    jsx: 'automatic',
    jsxImportSource: 'react',
  },
  test: {
    globals: true,
    watch: false,
    environment: 'jsdom',
    setupFiles: ['tests/setup/vitest.setup.ts'],
    include: [
      'core/**/*.{test,spec}.?(c|m)[jt]s?(x)',
      'adapters/**/*.{test,spec}.?(c|m)[jt]s?(x)',
      'apps/**/*.{test,spec}.?(c|m)[jt]s?(x)',
      'tests/**/*.{test,spec}.?(c|m)[jt]s?(x)',
    ],
    exclude: [
      'node_modules/**',
      '**/dist/**',
      '**/.next/**',
      'tests/smoke/website-pages.spec.ts',
    ],
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, './apps/website'),
      '@core': resolve(__dirname, './core'),
      '@adapters': resolve(__dirname, './adapters'),
      '@testing': resolve(__dirname, './adapters/testing'),
    },
  },
});
