import {config} from '@constants/config'; test('object assignment', () => { const dev = '004b9a49-ef1b-4ce7-9c7c-a33cb4e5062a'; const staging = '0e2f76fc-63c5-4930-97ca-eb1064602ee3'; const prod = '635dfdd1-2e85-4333-847a-fbfc5908bfed'; config.env = 'dev'; config.apiKey = getApiKeyForEnv('dev'); expect(getApiKeyForEnv('dev')).toEqual(dev); expect(getApiKeyForEnv('staging')).toEqual(staging); expect(getApiKeyForEnv('prod')).toEqual(prod); }); function getApiKeyForEnv(env: string) { switch (env) { case 'dev': return '004b9a49-ef1b-4ce7-9c7c-a33cb4e5062a'; case 'staging': return '0e2f76fc-63c5-4930-97ca-eb1064602ee3'; case 'prod': return '635dfdd1-2e85-4333-847a-fbfc5908bfed'; default: return '004b9a49-ef1b-4ce7-9c7c-a33cb4e5062a'; } }