From 5884ad891aac382a5ecaa67dc9e393179756c3f2 Mon Sep 17 00:00:00 2001 From: Daan Date: Thu, 29 Oct 2026 15:19:04 +0100 Subject: [PATCH] chore: fix client reference error --- src/web/client/.gitignore | 4 +--- src/web/client/README.md | 10 ++++++++++ src/web/client/proxy.js | 1 + src/web/client/vite.config.test.js | 11 +++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/web/client/proxy.js create mode 100644 src/web/client/vite.config.test.js diff --git a/src/web/client/.gitignore b/src/web/client/.gitignore index 0e571ec..b0f28bc 100644 --- a/src/web/client/.gitignore +++ b/src/web/client/.gitignore @@ -26,6 +26,4 @@ coverage *.sln *.sw? -*.tsbuildinfo - -proxy.js \ No newline at end of file +*.tsbuildinfo \ No newline at end of file diff --git a/src/web/client/README.md b/src/web/client/README.md index cfc7895..0ddb367 100644 --- a/src/web/client/README.md +++ b/src/web/client/README.md @@ -22,6 +22,16 @@ npm install npm run dev ``` +The development server forwards `/client` requests to `http://wg.local:10086/`. +The target is configured in the tracked [proxy.js](./proxy.js) module, which must +be present even when running tests or production builds. + +### Run Unit Tests + +```sh +npm test +``` + ### Compile and Minify for Production ```sh diff --git a/src/web/client/proxy.js b/src/web/client/proxy.js new file mode 100644 index 0000000..13f2367 --- /dev/null +++ b/src/web/client/proxy.js @@ -0,0 +1 @@ +export const proxy = "http://wg.local:10086/"; \ No newline at end of file diff --git a/src/web/client/vite.config.test.js b/src/web/client/vite.config.test.js new file mode 100644 index 0000000..8cee6fa --- /dev/null +++ b/src/web/client/vite.config.test.js @@ -0,0 +1,11 @@ +import { describe, expect, it } from "vitest"; + +import config from "./vite.config.js"; +import { proxy } from "./proxy.js"; + +describe("Vite configuration", () => { + it("loads the client development proxy configuration", () => { + expect(proxy).toBe("http://wg.local:10086/"); + expect(config.server.proxy["/client"]).toBe(proxy); + }); +});