From d007a13c03fc1b02079ad7e37f4ca7fb7bae11c4 Mon Sep 17 00:00:00 2001 From: yrimal Date: Wed, 24 Jan 2024 18:05:44 -0500 Subject: [PATCH] #602 fix errors when calling validate functions --- src/lib/environment.js | 2 +- test/lib/environment.spec.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/environment.js b/src/lib/environment.js index 1fd8057bf..8a7c35c4c 100644 --- a/src/lib/environment.js +++ b/src/lib/environment.js @@ -20,7 +20,7 @@ const initialize = ( } Object.assign(state, { - apiUrl: apiUrl.toString(), + apiUrl: apiUrl && apiUrl.toString(), archiveDestination, extraArgs, initialized: true, diff --git a/test/lib/environment.spec.js b/test/lib/environment.spec.js index 84678580c..5eaf721c4 100644 --- a/test/lib/environment.spec.js +++ b/test/lib/environment.spec.js @@ -17,6 +17,13 @@ describe('environment', () => { }); }); + describe('apiUrl initialize empty', ()=>{ + it('undefined apiUrl remains undefined', ()=>{ + environment.initialize('','','','',undefined,'force','true','true'); + expect(environment.apiUrl).to.be.undefined; + }); + }); + describe('isProduction', () => { it('localhost and port environment return false', () => {