import { defineConfig } from 'vitest/config'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'

/**
 * Vitest config for frontend unit tests.
 *
 * Covers pure-TS modules and Vue components (mounted via createApp in tests).
 * happy-dom provides window/localStorage/__TAURI_INTERNALS__ shims.
 */
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src'),
    },
  },
  test: {
    environment: 'happy-dom',
    globals: false,
    include: ['tests/unit/**/*.test.ts'],
    reporters: process.env.CI ? ['default'] : ['default'],
  },
})
