mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 01:28:05 +00:00
Use bundled GAME_ENV for client config
This commit is contained in:
@@ -6,14 +6,16 @@ import {
|
||||
} from "../../../src/core/configuration/ConfigLoader";
|
||||
|
||||
describe("ConfigLoader", () => {
|
||||
const originalGameEnv = process.env.GAME_ENV;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
window.BOOTSTRAP_CONFIG = undefined;
|
||||
process.env.GAME_ENV = originalGameEnv;
|
||||
clearCachedServerConfig();
|
||||
});
|
||||
|
||||
test("uses bootstrap config without fetching /api/env", async () => {
|
||||
window.BOOTSTRAP_CONFIG = { gameEnv: "prod" };
|
||||
test("uses bundled GAME_ENV without fetching /api/env", async () => {
|
||||
process.env.GAME_ENV = "prod";
|
||||
const fetchSpy = vi.spyOn(globalThis, "fetch");
|
||||
|
||||
const config = await getServerConfigFromClient();
|
||||
|
||||
Reference in New Issue
Block a user