import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
    plugins: [react(), tsconfigPaths({ ignoreConfigErrors: true })],
    test: {
        environment: 'jsdom',
        globals: true,
        setupFiles: ['./assets/admin/test/setup.ts'],
        include: ['assets/admin/**/*.{test,spec}.{ts,tsx}'],
        css: false,
        clearMocks: true,
        restoreMocks: true,
        coverage: {
            provider: 'v8',
            include: ['assets/admin/**/*.{ts,tsx}'],
            exclude: [
                'assets/admin/**/*.{test,spec}.*',
                'assets/admin/test/**',
                'assets/admin/index.tsx',
            ],
        },
    },
});
