Added enterpriseVersion to root of IUnleashConfig/IUnleashOptions

This commit is contained in:
Christopher Kolstad
2021-04-23 11:05:25 +02:00
parent c58612fc8f
commit 8845c90f57
4 changed files with 11 additions and 5 deletions
+1
View File
@@ -196,6 +196,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig {
preHook: options.preHook,
preRouterHook: options.preRouterHook,
eventHook: options.eventHook,
enterpriseVersion: options.enterpriseVersion,
};
}
@@ -65,8 +65,8 @@ test.serial('supports setting enterprise version as well', async t => {
getLogger,
versionCheck: { url: testurl, enable: true },
version,
enterpriseVersion,
},
enterpriseVersion,
);
await service.checkLatestVersion();
fetchMock.done();
@@ -104,8 +104,8 @@ test.serial(
getLogger,
versionCheck: { url: testurl, enable: false },
version,
enterpriseVersion,
},
enterpriseVersion,
);
await service.checkLatestVersion();
t.false(fetchMock.called(testurl));
+6 -3
View File
@@ -41,14 +41,17 @@ export default class VersionService {
{
getLogger,
versionCheck,
}: Pick<IUnleashConfig, 'getLogger' | 'versionCheck'>,
enterpriseVersion?: string,
enterpriseVersion,
}: Pick<
IUnleashConfig,
'getLogger' | 'versionCheck' | 'enterpriseVersion'
>,
) {
this.logger = getLogger('lib/services/version-service.js');
this.settingStore = settingStore;
this.current = {
oss: version,
enterprise: enterpriseVersion,
enterprise: enterpriseVersion || '',
};
this.enabled = versionCheck.enable;
this.versionCheckUrl = versionCheck.url;
+2
View File
@@ -87,6 +87,7 @@ export interface IUnleashOptions {
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
enterpriseVersion?: string;
}
export interface IEmailOption {
@@ -125,4 +126,5 @@ export interface IUnleashConfig {
preHook?: Function;
preRouterHook?: Function;
eventHook?: Function;
enterpriseVersion?: string;
}