import { getBaseUrl } from '../api.utils' describe('getBaseUrl', () => { it('should return the correct base URL for a dev environment', () => { const publicApiKey = 'dev_1234567890' const expectedUrl = 'https://api-dev.y.uno/v1' const result = getBaseUrl(publicApiKey) expect(result).toBe(expectedUrl) }) it('should return the correct base URL for a staging environment', () => { const publicApiKey = 'staging_1234567890' const expectedUrl = 'https://api-staging.y.uno/v1' const result = getBaseUrl(publicApiKey) expect(result).toBe(expectedUrl) }) it('should return the correct base URL for a sandbox environment', () => { const publicApiKey = 'sandbox_1234567890' const expectedUrl = 'https://api-sandbox.y.uno/v1' const result = getBaseUrl(publicApiKey) expect(result).toBe(expectedUrl) }) it('should return the correct base URL for a prod environment', () => { const publicApiKey = 'prod_1234567890' const expectedUrl = 'https://api.y.uno/v1' const result = getBaseUrl(publicApiKey) expect(result).toBe(expectedUrl) }) it('should throw an error for an invalid public API key', () => { const publicApiKey = 'invalidApiKey' expect(() => { getBaseUrl(publicApiKey) }).toThrowError('Not environment found publicApiKey: invalidApiKey, apiKeyPrefix: invalidApiKey, environmentSuffix: undefined') }) })