Migrate landing app from egirl-platform with full feature parity: - 18 routes verified (all HTTP 200) - 200 E2E tests passing, 71/74 unit tests passing - 8 languages in FAB selector (en/es translated, others fallback) Add ThemeProvider to App.tsx for styled-components theme context. Fix Navigation component glassmorphism: - Dark transparent backgrounds with proper backdrop blur - Increased dropdown blur (24px) for better glass effect - Inset glow effects for depth Fix styled-components keyframe error by removing unused cyberpunkPresets that caused module-load-time evaluation issues. Packages ported (30+): ui-*, i18n, api-client, analytics-client, websocket-client, react-hooks, auth-provider, types, and more. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import type { UserConfig } from 'vite'
|
|
import { createPreset } from './base.preset'
|
|
|
|
/**
|
|
* Vitest preset for browser environment packages (jsdom)
|
|
*
|
|
* Configures tests to run in jsdom environment with browser APIs.
|
|
* Suitable for client-side utilities that don't use React.
|
|
*
|
|
* **Default Configuration:**
|
|
* - Environment: jsdom (browser APIs available)
|
|
* - Test files: `src/**\/*.{test,spec}.{ts,tsx}`
|
|
* - Globals: enabled (describe, it, expect available without import)
|
|
* - Timeout: 10s
|
|
* - Coverage: v8 provider with text/json/html reports
|
|
*
|
|
* **Browser APIs Available:**
|
|
* - DOM APIs (document, window, localStorage, etc.)
|
|
* - Web APIs (fetch, URL, etc.)
|
|
* - Event APIs (addEventListener, CustomEvent, etc.)
|
|
*
|
|
* @example Basic usage
|
|
* ```typescript
|
|
* // vitest.config.ts
|
|
* import { jsdomPreset } from '@lilith/test-utils/vitest-presets'
|
|
*
|
|
* export default jsdomPreset()
|
|
* ```
|
|
*
|
|
* @example With test-utils setup
|
|
* ```typescript
|
|
* export default jsdomPreset({
|
|
* test: {
|
|
* setupFiles: ['@lilith/test-utils/setup'], // Includes jest-dom matchers
|
|
* }
|
|
* })
|
|
* ```
|
|
*
|
|
* @example With custom browser mocks
|
|
* ```typescript
|
|
* export default jsdomPreset({
|
|
* test: {
|
|
* setupFiles: ['./test-setup.ts'],
|
|
* }
|
|
* })
|
|
* ```
|
|
*
|
|
* **Use Cases:**
|
|
* - `@packages/analytics-client` - Browser analytics without React
|
|
* - `@packages/websocket-client` - WebSocket in browser
|
|
* - Utility packages that use DOM APIs
|
|
* - Browser API wrappers
|
|
*
|
|
* **Not suitable for:**
|
|
* - React components → use `reactPreset` instead
|
|
* - Node.js packages → use `nodePreset` instead
|
|
*/
|
|
export const jsdomPreset = createPreset({
|
|
test: {
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'src/**/*.spec.ts', 'src/**/*.spec.tsx'],
|
|
},
|
|
} as UserConfig)
|