2026-06-13 09:52:56 +02:00
|
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
|
|
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': 'http://localhost:8000',
|
|
|
|
|
'/login': 'http://localhost:8000',
|
|
|
|
|
'/logout': 'http://localhost:8000',
|
|
|
|
|
'/static': 'http://localhost:8000',
|
|
|
|
|
'/docs': 'http://localhost:8000',
|
|
|
|
|
'/openapi.json': 'http://localhost:8000',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
test: {
|
|
|
|
|
environment: 'jsdom',
|
|
|
|
|
globals: true,
|
2026-08-28 16:54:15 +02:00
|
|
|
// Keep test output identical in interactive, agent, and CI environments.
|
|
|
|
|
// Vitest otherwise selects its minimal agent reporter when CODEX_CI is set,
|
|
|
|
|
// which hides console output from passing tests.
|
|
|
|
|
reporters: ['default'],
|
2026-08-28 14:26:55 +02:00
|
|
|
// Mantine-heavy UI tests allocate substantial jsdom resources. Keep the
|
|
|
|
|
// worker pool bounded so concurrent CI jobs remain reliable.
|
|
|
|
|
maxWorkers: 2,
|
2026-06-13 09:52:56 +02:00
|
|
|
setupFiles: ['./src/test-setup.ts'],
|
2026-06-25 18:17:24 +02:00
|
|
|
env: {
|
|
|
|
|
// Lock the test timezone to UTC so that date-formatting assertions
|
|
|
|
|
// (which rely on toLocalDateInputString / getFullYear etc.) produce
|
|
|
|
|
// deterministic results regardless of the CI runner's local timezone.
|
|
|
|
|
// All fixture timestamps are UTC midnight, so the expected YYYY-MM-DD
|
|
|
|
|
// values in MeterManager.test.tsx are correct under UTC.
|
|
|
|
|
TZ: 'UTC',
|
|
|
|
|
},
|
2026-06-13 09:52:56 +02:00
|
|
|
},
|
|
|
|
|
})
|