Add a test
This commit is contained in:
parent
e1d3c6ed20
commit
356745814a
@ -35,7 +35,9 @@ describe('API Configuration', () => {
|
|||||||
it('should return empty string in production mode', async () => {
|
it('should return empty string in production mode', async () => {
|
||||||
// Set production mode
|
// Set production mode
|
||||||
(import.meta.env as any).PROD = true;
|
(import.meta.env as any).PROD = true;
|
||||||
delete (import.meta.env as any).VITE_API_URL;
|
|
||||||
|
// It should not use VITE_API_URL
|
||||||
|
(import.meta.env as any).VITE_API_URL = 'http://custom-api:9999';
|
||||||
|
|
||||||
const { getApiUrl } = await import('../../src/config/api');
|
const { getApiUrl } = await import('../../src/config/api');
|
||||||
expect(getApiUrl()).toBe('');
|
expect(getApiUrl()).toBe('');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user