mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
test: юнит-тесты на форматирование и разбивки крипто-портфеля + версия 1.1.6
Vitest для чистой логики: lib/format.ts (заодно поймал баг в trimTrailingZeros на "-0.000") и расчёт разбивки по риску/монете/сети на вкладке Crypto — вынес их из компонентов в отдельные тестируемые функции. Тесты подключены в CI. Версия приложения обновлена до 1.1.6.
This commit is contained in:
21
frontend/vitest.config.ts
Normal file
21
frontend/vitest.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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",
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user