Skip to content

Commit bee1bc1

Browse files
committed
test: use real environment values in unit test mocks
1 parent 29b5cde commit bee1bc1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vite.config.unit.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import process from "node:process";
5+
56
import { defineConfig } from "vite";
7+
8+
import getPackageVersion from "./scripts/environment.js";
69
import base from "./vite.config.mjs";
710

811
// https://vitejs.dev/config/
@@ -25,12 +28,11 @@ export default defineConfig({
2528
},
2629
load(id) {
2730
if (id === "/virtual:environment-mock") {
28-
// Simple stub - the actual values are mocked when testing
2931
return `
30-
export const THEME = "stub";
31-
export const PACKAGE_SOURCE = "stub";
32-
export const PACKAGE_VERSION = "stub";
33-
export const SYSTEM = "stub";
32+
export const PACKAGE_SOURCE = "chat-components";
33+
export const PACKAGE_VERSION = "${getPackageVersion()}";
34+
export const THEME = "open-source-visual-refresh";
35+
export const SYSTEM = "core";
3436
export const ALWAYS_VISUAL_REFRESH = true;
3537
`;
3638
}

0 commit comments

Comments
 (0)