Files
aurum/frontend/vitest.config.ts
ZProger f5c6591310 test: юнит-тесты на форматирование и разбивки крипто-портфеля + версия 1.1.6
Vitest для чистой логики: lib/format.ts (заодно поймал баг в
trimTrailingZeros на "-0.000") и расчёт разбивки по риску/монете/сети
на вкладке Crypto — вынес их из компонентов в отдельные тестируемые
функции. Тесты подключены в CI. Версия приложения обновлена до 1.1.6.
2026-09-09 00:52:27 +03:00

22 lines
810 B
TypeScript

import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
// Separate from vite.config.ts (the app config) since the unit tests here
// are plain-function tests over lib/ logic — no dev server, no proxy, no
// React plugin needed, so pulling in the app's own config would just be
// dead weight. Still needs jsdom, not plain "node": lib/i18n.ts reads
// localStorage at module load time (readInitialLanguage), which doesn't
// exist as a Node global.
export default defineConfig({
resolve: {
// Mirrors tsconfig.app.json's "@/*" path mapping — Vite/Vitest don't
// read tsconfig paths on their own, this is TypeScript-only otherwise.
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
test: {
environment: "jsdom",
},
});