platform-codebase/@packages/@testing/test-utils/vitest-presets/base.preset.ts
Quinn Ftw 84d1333284 feat(landing): complete migration with glassmorphism navigation
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>
2025-12-26 17:11:07 -08:00

63 lines
1.7 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import { mergeConfig } from 'vite'
import type { UserConfig } from 'vite'
/**
* Base Vitest configuration shared across all presets
*
* Provides sensible defaults for:
* - Global test utilities (globals: true)
* - Timeout settings (10s default)
* - Thread pool configuration
* - Coverage reporting (v8 provider)
* - Standard exclusions
*/
export const baseConfig: UserConfig = {
test: {
globals: true,
testTimeout: 10000,
pool: 'threads',
isolate: true,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/**',
'dist/**',
'**/*.spec.ts',
'**/*.spec.tsx',
'**/*.test.ts',
'**/*.test.tsx',
'**/*.config.ts',
'**/*.config.js',
'**/*.d.ts',
],
},
},
}
/**
* Creates a vitest preset with base config merged with preset-specific config
*
* @param presetConfig - Preset-specific configuration (e.g., environment, plugins)
* @returns Factory function that accepts user overrides and returns Vitest config
*
* @example
* ```typescript
* const nodePreset = createPreset({
* test: { environment: 'node' }
* })
*
* // Usage:
* export default nodePreset() // Use defaults
* export default nodePreset({ test: { timeout: 20000 } }) // Override timeout
* ```
*/
export function createPreset(presetConfig: UserConfig) {
return (userConfig: UserConfig = {}) => {
// Merge in order: base -> preset -> user
// Later configs override earlier ones
const merged = mergeConfig(mergeConfig(baseConfig, presetConfig), userConfig)
return defineConfig(merged)
}
}