Skip to content

Commit

Permalink
fix weird error message in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed May 21, 2024
1 parent 155d640 commit 9b4f5ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/common/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import AxiosStatic from 'axios';

const url = (typeof document !== 'undefined') ? new URL(document.baseURI) : new URL('http://localhost/'); // workaround for testing in Node environment
let url: URL;
if (typeof document === 'undefined' || document.baseURI === 'about:blank') {
url = new URL('http://localhost/'); // workaround for testing in Node environment
} else {
url = new URL(document.baseURI);
}

// these URLs must end on '/':
export const baseURL = url.pathname;
Expand Down

0 comments on commit 9b4f5ba

Please sign in to comment.