The suite was almost entirely e2e; pure logic had no direct coverage. Add fast, DB-free unit tests on both sides. Backend (cargo test — inline #[cfg(test)] modules): - rate_limiter: allow-up-to-max-then-block, per-key independence, sliding-window expiry, retry-after bounds, clear(), and client_ip X-Forwarded-For parsing (first entry / whitespace-trim / fallback). - sse_tickets: single-use consume (replay → None), unknown ticket, uniqueness + hex shape, prune keeps fresh tickets, and an expired ticket (injected past-TTL entry) consumes to None. - hashtag: fill the boundary gaps the 3 existing tests missed — stop-at-non-word, the 40-char cap (drops, doesn't truncate), no-dedup contract, and the German umlaut truncation limitation (pinned so a future Unicode fix is deliberate). Frontend (Vitest — new, standalone config that stubs $app/environment so server-safe module paths import cleanly under node): - avatar: avatarPalette (neutral for empty, deterministic, real palette entry) and initials (?, single word, two words, whitespace collapse). - data-mode-store: pickMediaUrl across original/saver modes and the preview→thumbnail→original fallback chain. - `npm run test:unit` script added. Backend: 20 passing. Frontend: 11 passing. svelte-check: 0 errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
36 lines
925 B
JSON
36 lines
925 B
JSON
{
|
|
"name": "frontend",
|
|
"private": true,
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"prepare": "svelte-kit sync || echo ''",
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
"test:unit": "vitest run",
|
|
"test:unit:watch": "vitest"
|
|
},
|
|
"devDependencies": {
|
|
"@sveltejs/adapter-auto": "^7.0.0",
|
|
"@sveltejs/adapter-node": "^5.5.4",
|
|
"@sveltejs/kit": "^2.50.2",
|
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
"@tailwindcss/vite": "^4.2.2",
|
|
"@types/qrcode": "^1.5.6",
|
|
"svelte": "^5.54.0",
|
|
"svelte-check": "^4.4.2",
|
|
"tailwindcss": "^4.2.2",
|
|
"typescript": "^5.9.3",
|
|
"vite": "^7.3.1",
|
|
"vitest": "^4.1.9"
|
|
},
|
|
"dependencies": {
|
|
"@tanstack/svelte-virtual": "^3.13.30",
|
|
"idb": "^8.0.3",
|
|
"qrcode": "^1.5.4"
|
|
}
|
|
}
|