mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
14 lines
691 B
TypeScript
14 lines
691 B
TypeScript
import { getDefaultApiUrl } from './getDefaultApiUrl';
|
|
|
|
it.each([
|
|
['https://next.roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
|
['https://roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
|
['https://notroleypolybutclose.com/servers', 'https://api-prod.roleypoly.com'],
|
|
['https://myhash.roleypoly.pages.dev/servers', 'https://api-stage.roleypoly.com'],
|
|
['http://localhost:6601/servers', 'http://localhost:6609'],
|
|
['http://127.0.0.1:6601/servers', 'http://localhost:6609'],
|
|
])('matches %s to %s', (inputUrl, outputUrl) => {
|
|
const urlHostname = new URL(inputUrl).hostname;
|
|
|
|
expect(getDefaultApiUrl(urlHostname)).toStrictEqual(outputUrl);
|
|
});
|