-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: config (stateless, fhir base, defaults)
- Loading branch information
Showing
2 changed files
with
71 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved | ||
* Project name: FUME | ||
*/ | ||
|
||
import { test } from '@jest/globals'; | ||
|
||
import config from './config'; | ||
|
||
describe('setServerConfig', () => { | ||
test('Uses defaults', async () => { | ||
config.setServerConfig({}); | ||
expect(config.getServerConfig()).toEqual({ | ||
EXCLUDE_FHIR_PACKAGES: '', | ||
FHIR_PACKAGES: '[email protected],[email protected],[email protected],laniado.test.fhir.r4', | ||
FHIR_SERVER_AUTH_TYPE: 'NONE', | ||
FHIR_SERVER_BASE: '', | ||
FHIR_SERVER_PW: '', | ||
FHIR_SERVER_TIMEOUT: 10000, | ||
FHIR_SERVER_UN: '', | ||
FHIR_VERSION: '4.0.1', | ||
SEARCH_BUNDLE_PAGE_SIZE: 20, | ||
SERVER_PORT: 42420, | ||
SERVER_STATELESS: true | ||
}); | ||
}); | ||
|
||
test('Uses defaults, with FHIR_SERVER_BASE, sets stateless to false', async () => { | ||
config.setServerConfig({ | ||
FHIR_SERVER_BASE: 'http://hapi-fhir.outburn.co.il/fhir-test ' | ||
}); | ||
expect(config.getServerConfig()).toEqual({ | ||
EXCLUDE_FHIR_PACKAGES: '', | ||
FHIR_PACKAGES: '[email protected],[email protected],[email protected],laniado.test.fhir.r4', | ||
FHIR_SERVER_AUTH_TYPE: 'NONE', | ||
FHIR_SERVER_BASE: 'http://hapi-fhir.outburn.co.il/fhir-test', | ||
FHIR_SERVER_PW: '', | ||
FHIR_SERVER_TIMEOUT: 10000, | ||
FHIR_SERVER_UN: '', | ||
FHIR_VERSION: '4.0.1', | ||
SEARCH_BUNDLE_PAGE_SIZE: 20, | ||
SERVER_PORT: 42420, | ||
SERVER_STATELESS: false | ||
}); | ||
}); | ||
|
||
test('Uses defaults, without FHIR_SERVER_BASE, sets stateless to true', async () => { | ||
config.setServerConfig({ | ||
SERVER_STATELESS: false | ||
}); | ||
expect(config.getServerConfig()).toEqual({ | ||
EXCLUDE_FHIR_PACKAGES: '', | ||
FHIR_PACKAGES: '[email protected],[email protected],[email protected],laniado.test.fhir.r4', | ||
FHIR_SERVER_AUTH_TYPE: 'NONE', | ||
FHIR_SERVER_BASE: '', | ||
FHIR_SERVER_PW: '', | ||
FHIR_SERVER_TIMEOUT: 10000, | ||
FHIR_SERVER_UN: '', | ||
FHIR_VERSION: '4.0.1', | ||
SEARCH_BUNDLE_PAGE_SIZE: 20, | ||
SERVER_PORT: 42420, | ||
SERVER_STATELESS: true | ||
}); | ||
}); | ||
}); |
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