import path from 'path'; import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { // Use happy-dom for faster DOM testing environment: 'happy-dom', // Include test files include: ['tests/frontend/unit/**/*.{test,spec}.{js,mjs,cjs}'], // Global test utilities globals: true, // Coverage configuration coverage: { provider: 'v8', reporter: ['text', 'html', 'json'], reportsDirectory: './htmlcov_frontend', include: ['src/server/web/static/js/**/*.js'], exclude: [ 'node_modules/', 'tests/', '**/*.test.js', '**/*.spec.js' ], all: true, lines: 80, functions: 80, branches: 80, statements: 80 }, // Test timeout (30 seconds) testTimeout: 30000, // Hook timeout (10 seconds) hookTimeout: 10000 }, resolve: { alias: { '@': path.resolve(__dirname, './src/server/web/static/js') } } });