import { defineConfig } from 'vitest/config';

const config = async () => {
  const { default: vue } = await import('@vitejs/plugin-vue');

  return {
    plugins: [vue()],
    test: {
      environment: 'happy-dom',
      include: ['tests/**/*.test.ts'],
    },
  };
};

// Vitest 3 accepts async configs at runtime, but its bundled Vite 5 types omit them.
export default defineConfig(config as Parameters<typeof defineConfig>[0]);
