[MM-39885] Migrate unit tests to Jest, fleshed out tests for common/util, a bunch of cleanup (#1852)
* [MM-39885] Migrate unit tests to Jest, fleshed out tests for common/util/url * Typo fix * Oops * I found more tests! * Fixed a bug * Oops again * Tests for common/utils/util * A bunch of cleanup * Oops
This commit is contained in:
@@ -13,20 +13,4 @@ export class MattermostServer {
|
||||
throw new Error('Invalid url for creating a server');
|
||||
}
|
||||
}
|
||||
|
||||
getServerInfo = () => {
|
||||
// does the server have a subpath?
|
||||
const normalizedPath = this.url.pathname.toLowerCase();
|
||||
const subpath = normalizedPath.endsWith('/') ? normalizedPath : `${normalizedPath}/`;
|
||||
return {origin: this.url.origin, subpath, url: this.url.toString()};
|
||||
}
|
||||
|
||||
sameOrigin = (otherURL: string) => {
|
||||
const parsedUrl = urlUtils.parseURL(otherURL);
|
||||
return parsedUrl && this.url.origin === parsedUrl.origin;
|
||||
}
|
||||
|
||||
equals = (otherServer: MattermostServer) => {
|
||||
return (this.name === otherServer.name) && (this.url.toString() === otherServer.url.toString());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user