-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import { describe, it, expect } from 'vitest' | ||
|
||
import { API_BASE_PREFIX, API_BASE_PREFIX_ANNONARS, API_BASE_PREFIX_MEHARI } from '../common' | ||
import { API_BASE_PREFIX, API_BASE_PREFIX_ANNONARS, API_BASE_PREFIX_MEHARI, API_BASE_PREFIX_NGINX } from '../common' | ||
|
||
describe.concurrent('API_BASE_PREFIX constants', () => { | ||
it('returns the correct API base prefix in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_BASE_PREFIX).toBe('/') | ||
expect(API_BASE_PREFIX).toBe('/internal/') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
|
||
it('returns the correct API base prefix for annonars in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_BASE_PREFIX_ANNONARS).toBe('/proxy/annonars') | ||
expect(API_BASE_PREFIX_ANNONARS).toBe('/internal/proxy/annonars') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
|
||
it('returns the correct API base prefix for mehari in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_BASE_PREFIX_MEHARI).toBe('/proxy/mehari') | ||
expect(API_BASE_PREFIX_MEHARI).toBe('/internal/proxy/mehari') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
|
||
it('returns the correct API base prefix for nginx in production mode', () => { | ||
const originalMode = import.meta.env.MODE | ||
expect(API_BASE_PREFIX_NGINX).toBe('/internal/proxy/nginx') | ||
import.meta.env.MODE = originalMode | ||
}) | ||
}) |