lilith-platform.live/codebase/@features/landing/frontend-public/vitest.browser.config.ts
Claude Code 25d2c7ad65 init(codebase-default): 🎉 Implement foundational directory structure with core modules and utility files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-03-25 22:50:24 -07:00

44 lines
1.1 KiB
TypeScript

/**
* Vitest Browser Mode Configuration for Component Tests
*
* Uses Playwright to run component tests in a real browser instead of jsdom.
* This solves styled-components + React 19 compatibility issues.
*
* Run with: pnpm test:components
*
* @see https://vitest.dev/guide/browser/
* @see https://vitest.dev/guide/browser/component-testing
*/
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { playwright } from '@vitest/browser-playwright';
import path from 'path';
export default defineConfig({
plugins: [react()],
test: {
name: 'browser',
// Component and hook tests only
include: ['src/**/*.spec.tsx', 'src/**/hooks/*.test.tsx', 'src/**/components/*.test.tsx'],
exclude: [
'node_modules/**',
'dist/**',
'e2e/**',
'**/*.d.ts',
],
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium' }],
headless: true,
},
// Use vitest-browser-react for rendering
setupFiles: ['./vitest.browser.setup.ts'],
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});