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

export default defineConfig({
  test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: ['./src/__tests__/setup-render.tsx'],
    include: ['src/__tests__/components/rendering/**/*.test.tsx', 'src/__tests__/integration/*.render.test.tsx'],
    testTimeout: 15000,
    hookTimeout: 15000,
    pool: 'forks',
    execArgv: ['--require', resolve(__dirname, 'src/__tests__/mocks/preload-rn-mock.cjs')],
    server: {
      deps: {
        inline: [
          '@testing-library/react-native',
          'react-native-reanimated',
          'react-native-gesture-handler',
          'react-native-screens',
          'react-native-safe-area-context',
          'react-native-svg',
        ],
      },
    },
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, '.'),
      'react-native': resolve(__dirname, 'src/__tests__/mocks/react-native.ts'),
    },
  },
})
