Test for window existence on global object
This fixes running tests in Jasmine where window not defined
This commit is contained in:
parent
605765a86f
commit
00464f7144
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user