63f11452cd
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)
28 lines
606 B
JavaScript
28 lines
606 B
JavaScript
/// <reference types="vitest" />
|
|
import { defineConfig } from "vite";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
|
|
export default defineConfig({
|
|
plugins: [svelte()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": "http://localhost:8765",
|
|
"/games": "http://localhost:8765",
|
|
"/artwork": "http://localhost:8765",
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
resolve: {
|
|
conditions: process.env.VITEST ? ["browser", "module", "import"] : [],
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
globals: true,
|
|
include: ["src/**/*.test.js"],
|
|
},
|
|
});
|