Files
siftlode/frontend/vitest.config.ts
T
peter da728f0c5e test(format): cover the relative-time tier boundaries
The repo had no unit-test runner, so this adds the minimum: vitest (3.x, as
4.x needs Vite 6), a node-env config deliberately separate from vite.config.ts
so the production build never loads it, npm test / test:watch, and a knip
entry so the config and specs are not reported unused. Browser flows stay in
e2e/ under Playwright.

The suite samples every tier at its exact opening second as well as inside it,
and stubs i18n so each assertion lands on the key rather than the copy. An
interior-only suite still passes when the range comparison flips to <=, which
is how the tier shift went unnoticed for so long.
2026-07-20 03:06:50 +02:00

14 lines
623 B
TypeScript

import { defineConfig } from "vitest/config";
// Unit tests for the pure helpers in src/lib — deliberately separate from vite.config.ts so the
// production build never has to load vitest. Plain node env (no jsdom): these tests stub the
// modules that touch the DOM. Browser flows stay in e2e/ under Playwright (`siftlode e2e`).
// Being its own file means vite.config.ts is NOT merged in — a future test that renders a .tsx
// component has to wire @vitejs/plugin-react (and a DOM environment) here itself.
export default defineConfig({
test: {
include: ["src/**/*.test.ts"],
environment: "node",
},
});