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

export default defineWorkspace([
  {
    extends: './vitest.config.ts',
    test: {
      name: 'renderer',
      environment: 'jsdom',
      include: ['test/**/*.test.{ts,tsx}'],
      exclude: [
        'test/session-3/**/*.test.ts',
        'test/phase-9/session-2/**/*.test.ts',
        'test/phase-9/session-5/**/*.test.ts',
        'test/phase-9/session-13/**/*.test.ts',
        'test/server/**/*.test.ts',
        'test/lsp/**/*.test.ts',
        'test/phase-21-5/**/*.test.ts',
        'test/phase-24/**/*.test.ts',
        'test/phase-24c/**/*.test.ts'
      ]
    }
  },
  {
    test: {
      name: 'main',
      environment: 'node',
      include: [
        'test/session-3/**/*.test.ts',
        'test/phase-9/session-2/**/*.test.ts',
        'test/phase-9/session-5/**/*.test.ts',
        'test/phase-9/session-13/**/*.test.ts',
        'test/server/**/*.test.ts',
        'test/lsp/**/*.test.ts',
        'test/phase-21/**/*.test.ts',
        'test/phase-21-5/**/*.test.ts',
        'test/phase-24/**/*.test.ts',
        'test/phase-24c/**/*.test.ts'
      ],
      globals: true
    },
    resolve: {
      alias: {
        '@shared': resolve(__dirname, 'src/shared')
      }
    }
  }
])
