Add Vitest + testing-library/react + jsdom for frontend testing. Tests cover: cn() utility (6), usePermissions hook (27), useTreeValidation hook (22), and userPreferencesStore (6). CI updated to run frontend tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
/// <reference types="vitest/config" />
|
|
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: './src/test/setup.ts',
|
|
include: ['src/**/*.{test,spec}.{ts,tsx}'],
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// React core and routing
|
|
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
|
// Markdown rendering
|
|
'markdown-vendor': ['react-markdown'],
|
|
// State management
|
|
'state-vendor': ['zustand', 'immer', 'zundo'],
|
|
// Icons
|
|
'icons-vendor': ['lucide-react'],
|
|
// Utilities and UI libs
|
|
'utils-vendor': [
|
|
'axios',
|
|
'clsx',
|
|
'tailwind-merge',
|
|
'class-variance-authority',
|
|
'date-fns',
|
|
'sonner',
|
|
],
|
|
// Drag and drop
|
|
'dnd-vendor': [
|
|
'@dnd-kit/core',
|
|
'@dnd-kit/sortable',
|
|
'@dnd-kit/utilities',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
chunkSizeWarningLimit: 500,
|
|
},
|
|
})
|