/** * Base Vitest Configuration * * Shared configuration for all apps and packages in the monorepo. * Individual apps can extend this and add app-specific settings. */ import { type UserConfig } from 'vitest/config' /** * Base test configuration for React apps * Use this for apps with React components */ export const reactTestConfig: UserConfig['test'] = { globals: true, environment: 'jsdom', passWithNoTests: true, coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], exclude: [ 'node_modules/**', 'dist/**', '**/*.d.ts', '**/*.config.*', '**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx', '**/test/**', '**/tests/**', '**/__tests__/**', '**/__mocks__/**', '**/e2e/**', 'src/mocks/**', ], }, } /** * Base test configuration for Node.js packages (no React) * Use this for pure TypeScript packages without UI */ export const nodeTestConfig: UserConfig['test'] = { globals: true, environment: 'node', passWithNoTests: true, include: ['src/**/*.test.ts', 'src/**/*.spec.ts'], testTimeout: 10000, pool: 'threads', isolate: true, coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], exclude: [ 'node_modules/**', 'dist/**', '**/*.d.ts', '**/*.config.*', '**/*.spec.ts', '**/*.test.ts', ], }, } /** * Common setup files for React apps * Apps can reference this array in their vitest.config.ts */ export const commonReactSetupFiles = [ // Add common setup files here as they're created // Example: '@lilith/test-utils/setup/react.ts' ] /** * Common setup files for Node packages */ export const commonNodeSetupFiles = [ // Add common setup files here ]