mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
- Fix vitest.config.ts fakemui alias path: ../../fakemui → ../../components/fakemui
(matches tsconfig.json paths; fixes pagination + get-component-icon tests)
- Add vi.mock('server-only') to route.test.ts to prevent server-only guard
throwing in jsdom environment
- Replace @jest/globals with vitest in workflow-error-handler and
multi-tenant-context test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import react from '@vitejs/plugin-react-swc'
|
|
import { resolve } from 'path'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
include: ['src/**/*.test.{ts,tsx}'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
},
|
|
deps: {
|
|
// Use inline to avoid duplicate React instances in tests
|
|
optimizer: {
|
|
web: {
|
|
include: ['react', 'react-dom']
|
|
}
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
dedupe: ['react', 'react-dom'],
|
|
alias: [
|
|
// fakemui aliases must be first (more specific matches first)
|
|
{ find: /^@\/fakemui\/(.+)$/, replacement: resolve(__dirname, '../../components/fakemui/$1') },
|
|
{ find: /^@\/fakemui$/, replacement: resolve(__dirname, '../../components/fakemui/index.ts') },
|
|
// dbal-ui alias for shared UI components
|
|
{ find: /^@dbal-ui\/(.+)$/, replacement: resolve(__dirname, '../../dbal/shared/ui/$1') },
|
|
{ find: /^@dbal-ui$/, replacement: resolve(__dirname, '../../dbal/shared/ui') },
|
|
// General @ alias last (least specific)
|
|
{ find: /^@\/(.+)$/, replacement: resolve(__dirname, './src/$1') },
|
|
],
|
|
},
|
|
})
|