mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-12 18:46:40 +07:00
Vitest для чистой логики: lib/format.ts (заодно поймал баг в trimTrailingZeros на "-0.000") и расчёт разбивки по риску/монете/сети на вкладке Crypto — вынес их из компонентов в отдельные тестируемые функции. Тесты подключены в CI. Версия приложения обновлена до 1.1.6.
22 lines
810 B
TypeScript
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",
|
|
},
|
|
});
|