jan/web/services/restService.test.ts
Louis 302b73ae73
test: add web helpers, services, utils tests (#3669)
* test: add web helpers tests

* fix: coverage report

* test: add more tests

* test: add more generated tests

* chore: add more tests

* test: add more tests
2024-09-20 14:24:51 +07:00

16 lines
385 B
TypeScript

test('restAPI.baseApiUrl set correctly', () => {
const originalEnv = process.env.API_BASE_URL;
process.env.API_BASE_URL = 'http://test-api.com';
// Re-import to get the updated value
jest.resetModules();
const { restAPI } = require('./restService');
expect(restAPI.baseApiUrl).toBe('http://test-api.com');
// Clean up
process.env.API_BASE_URL = originalEnv;
});