testsAndMisc/cloud_gallery/vite.config.ts
Krzysztof kuhy Rudnicki c6f1b85c78 cloud_gallery: fix build, 100% coverage, aggressive lint; whitelist dufs_client
- dufs-client.test.ts: type fetch mocks as vi.fn<typeof fetch>() (fixes the
  TS2493/TS2352 tuple/undefined build errors that broke `pnpm build`)
- dufs-client.ts: explicit method arg drops the unreachable `?? "GET"` branch
- gallery/grid: -1 viewer-index sentinel + pass media entry, removing three
  unreachable defensive guards; onOpenMedia now takes the entry
- use-hash-path: extract serverPath() so the SSR snapshot is covered
- eslint: strict+stylistic type-checked, react-hooks, reportUnusedDisable
  Directives; drop eslint-plugin-react (incompatible with ESLint 10)
- add grid.test.tsx + use-listing.test.ts; coverage thresholds 100/100/100/100
  (62 tests: statements/branches/functions/lines all 100%)
- phone_focus_mode/config.sh: whitelist com.kuhy.dufs_client

Deployed live via setup_cloud_gallery.sh (render-spa); fixed ffmpeg by
renaming a stale /usr/local/bin shadow linking the removed libvpx.so.11;
regenerated thumbnails (10 made, 0 failed). APK installed + launch-verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126QvdMrv2WNeUVShFiLTc3
2026-07-12 17:29:39 +02:00

23 lines
741 B
TypeScript

import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
// base: "./" so the built asset URLs are relative. The app is served by dufs
// with `render-spa` from the cloud root, and uses HashRouter, so the document
// path is always "/" and "./assets/..." resolves to "/assets/...".
export default defineConfig({
base: "./",
plugins: [react()],
server: { port: 5273 },
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
coverage: {
provider: "v8",
include: ["src/**/*.{ts,tsx}"],
exclude: ["src/main.tsx", "src/test/**", "src/**/*.d.ts"],
thresholds: { statements: 100, branches: 100, functions: 100, lines: 100 },
},
},
});