From 00464f71449fe7ed237c441bbfc930f38c7d3855 Mon Sep 17 00:00:00 2001 From: Lukas Hass Date: Mon, 24 Jan 2022 11:29:26 +0100 Subject: [PATCH] Test for window existence on global object This fixes running tests in Jasmine where window not defined --- front/src/Enum/EnvironmentVariable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index 91be4cd8..df8ec7e6 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -5,10 +5,10 @@ declare global { } const getEnv = (key: string): string | undefined => { - if (!window.env) { + if (!global.window || !global.window.env) { return; } - const value = window.env[key]; + const value = global.window.env[key]; if (value === "") { return; }