Skip to content

Commit

Permalink
#602 fix errors when calling validate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
1yuv committed Jan 24, 2024
1 parent d168379 commit d007a13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const initialize = (
}

Object.assign(state, {
apiUrl: apiUrl.toString(),
apiUrl: apiUrl && apiUrl.toString(),
archiveDestination,
extraArgs,
initialized: true,
Expand Down
7 changes: 7 additions & 0 deletions test/lib/environment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit d007a13

Please sign in to comment.