import path from 'node:path'; import { configDefaults, defineConfig } from 'vitest/config'; /** * Testy serveru lezi v `tests/` se stejnou cestou jako testovany modul * (`tests/data/permissions.test.ts` testuje `src/data/permissions.ts`). * Bezi v Node, bez databaze a bez site: co potrebuje ven, dostane vstrikle. */ export default defineConfig({ test: { include: ['tests/**/*.test.ts'], // Vykonove testy maji vlastni beh (`npm run test:perf`, vitest.perf.config.ts): // stavi desetitisice zaznamu a jejich rozpocty zavisi na stroji. exclude: [...configDefaults.exclude, 'tests/perf/**'], environment: 'node', // Promenne prostredi pro rezim pameti, viz tests/setup.ts. setupFiles: ['tests/setup.ts'], // Testy sdileji proces, ale kazdy soubor si drzi vlastni kopie ulozist. isolate: true, }, resolve: { alias: { '@shared': path.resolve(import.meta.dirname, 'src/shared'), }, }, });