cameras/vitest.config.mts
Michael Mainguy 190191df92 Add Lucide icons: camera status badge, actions and warnings
Adds lucide-react (vrek dec-1vnz5fw, chosen over Heroicons and React
Icons) for the icons goal gol-m8je1wc.

- Camera status badge on each card (iss-scj42jq): Live, Connecting,
  Needs login, Not activated, Offline, Session ended. Each is an icon
  plus a visible label, derived from existing query state with no
  extra device calls. Logic in src/app/camera-status.tsx.
- Action icons (iss-chrdd0v): scan (radar, then spinner), refresh
  rate, change or forget login, retry, the camera web page link
  (replaces ↗), save, sign in and sign out.
- Warning and error icons (iss-egy082x): unsecured banner, setup
  panel, inline errors, session-ended notice, login and setup
  headings.

Icons are decorative (aria-hidden), spinners respect reduced motion,
and every accessible name is unchanged (all 403 prior tests pass
untouched). 416 tests, 99.9% line coverage. The vitest threshold
comment now points to principle pri-be2smzk. Refreshes the vrek
export.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 12:33:16 -05:00

36 lines
1.2 KiB
TypeScript

import { fileURLToPath } from "node:url";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [react()],
resolve: {
// Resolves the "@/*" path alias from tsconfig.json.
tsconfigPaths: true,
alias: {
// The real package throws unless bundled for React Server Components.
"server-only": fileURLToPath(new URL("./test/server-only.ts", import.meta.url)),
},
},
test: {
// Server code runs in Node; component tests opt in with `// @vitest-environment jsdom`.
environment: "node",
include: ["src/**/*.test.{ts,tsx}", "scripts/**/*.test.ts"],
restoreMocks: true,
unstubEnvs: true,
coverage: {
provider: "v8",
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/**/*.test.{ts,tsx}",
"src/**/*.d.ts",
// Async Server Component: unit runners can't render it (Next docs, testing/vitest.md).
"src/app/page.tsx",
],
reporter: ["text", "json-summary"],
// vrek principle pri-be2smzk: `npm run coverage` fails if line coverage drops below 95%.
thresholds: { lines: 95 },
},
},
});