fume-fhir-converter
Version:
FHIR-Utilized Mapping Engine - Community
67 lines • 2.69 kB
JavaScript
"use strict";
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const globals_1 = require("@jest/globals");
const config_1 = tslib_1.__importDefault(require("./config"));
const serverDefaults = {
FHIR_PACKAGES: 'il.core.fhir.r4@0.11.0,hl7.fhir.us.core@6.0.0,fhir.outburn.co.il@0.0.1,laniado.test.fhir.r4',
FHIR_SERVER_AUTH_TYPE: 'NONE',
FHIR_SERVER_BASE: 'http://hapi-fhir.outburn.co.il/fhir',
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
};
jest.mock('./serverConfig', () => (serverDefaults));
describe('setServerConfig', () => {
(0, globals_1.test)('Uses defaults', async () => {
config_1.default.setServerConfig({});
expect(config_1.default.getServerConfig()).toEqual({
...serverDefaults,
FHIR_SERVER_BASE: '',
SERVER_STATELESS: true
});
});
(0, globals_1.test)('Uses defaults, with FHIR_SERVER_BASE, sets stateless to false', async () => {
config_1.default.setServerConfig({
FHIR_SERVER_BASE: 'http://hapi-fhir.outburn.co.il/fhir-test '
});
expect(config_1.default.getServerConfig()).toEqual({
FHIR_PACKAGES: 'il.core.fhir.r4@0.11.0,hl7.fhir.us.core@6.0.0,fhir.outburn.co.il@0.0.1,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
});
});
(0, globals_1.test)('Uses defaults, without FHIR_SERVER_BASE, sets stateless to true', async () => {
config_1.default.setServerConfig({
SERVER_STATELESS: false
});
expect(config_1.default.getServerConfig()).toEqual({
FHIR_PACKAGES: 'il.core.fhir.r4@0.11.0,hl7.fhir.us.core@6.0.0,fhir.outburn.co.il@0.0.1,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
});
});
});
//# sourceMappingURL=config.test.js.map