3x-ui/frontend/vitest.config.ts
MHSanaei 0b130d24ac
test(frontend): add React Testing Library + jsdom render-test harness
- vitest projects: node unit tests stay lean; new jsdom 'components' project runs *.test.tsx
- component setup: matchMedia/ResizeObserver/localStorage polyfills, react-i18next init, persian-calendar-suite stub (only used under jalali locale)
- smoke + field-label structure snapshots for Inbound & Outbound form modals
- establishes the regression net required before decomposing the oversized form modals
- 341 tests pass (337 unit + 4 component); typecheck/lint/build green
2026-05-30 15:51:49 +02:00

36 lines
787 B
TypeScript

import path from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
test: {
globals: false,
projects: [
{
extends: true,
test: {
name: 'unit',
include: ['src/test/**/*.test.ts'],
environment: 'node',
setupFiles: ['./src/test/setup.ts'],
},
},
{
extends: true,
test: {
name: 'components',
include: ['src/test/**/*.test.tsx'],
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts', './src/test/setup.components.ts'],
},
},
],
},
});