test: add frontend test suite with 54 tests
Build & Deploy / build-and-deploy (push) Successful in 23s

- Install vitest, @testing-library/svelte, jsdom
- Configure vitest in vite.config.js with browser conditions for Svelte 5
- Pure function tests for api.js (artworkUrl, bundleUrl, setupBundleUrl)
- Router tests (push, replace hash manipulation)
- GameCard component tests (title, year, genre, cover, badge, click)
- Library page tests (loading, empty, game grid, year/genre filters)
- GameDetail page tests (loading, error, display, edit mode, badges)
- Play page tests (loading, not-ready, unsupported, booting, error)
This commit is contained in:
Hermes Agent
2026-06-10 11:48:10 +02:00
parent 2a72c0a3aa
commit 63f11452cd
9 changed files with 2977 additions and 3 deletions
+9
View File
@@ -1,3 +1,4 @@
/// <reference types="vitest" />
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
@@ -15,4 +16,12 @@ export default defineConfig({
outDir: "dist",
emptyOutDir: true,
},
resolve: {
conditions: process.env.VITEST ? ["browser", "module", "import"] : [],
},
test: {
environment: "jsdom",
globals: true,
include: ["src/**/*.test.js"],
},
});