From 4fba441ee14fa9cec4089ce84a53ab13684c581b Mon Sep 17 00:00:00 2001 From: Antoine Arlaud Date: Fri, 10 May 2024 11:59:10 +0200 Subject: [PATCH] fix: version retrieval in preflight check --- lib/client/checks/config/brokerClientVersionCheck.ts | 2 +- .../client/checks/config/brokerClientVersionCheck.test.ts | 4 +--- .../brokerClientVersionSkipDevLocalVersionCheck.test.ts | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/client/checks/config/brokerClientVersionCheck.ts b/lib/client/checks/config/brokerClientVersionCheck.ts index 914af2eb3..eacde1447 100644 --- a/lib/client/checks/config/brokerClientVersionCheck.ts +++ b/lib/client/checks/config/brokerClientVersionCheck.ts @@ -7,7 +7,7 @@ export const validateBrokerClientVersionAgainstServer = async ( checkOptions: CheckOptions, config, ) => { - const clientVersion = version(); + const clientVersion = `${version}`; if (clientVersion != 'local') { const req: PostFilterPreparedRequest = { url: `${config.BROKER_SERVER_URL}/healthcheck`, diff --git a/test/unit/client/checks/config/brokerClientVersionCheck.test.ts b/test/unit/client/checks/config/brokerClientVersionCheck.test.ts index 6f85f1967..ab50f7db2 100644 --- a/test/unit/client/checks/config/brokerClientVersionCheck.test.ts +++ b/test/unit/client/checks/config/brokerClientVersionCheck.test.ts @@ -14,9 +14,7 @@ jest.mock('../../../../../lib/common/utils/version', () => { return { __esModule: true, ...originalModule, - default: () => { - return '4.180.0'; - }, + default: '4.180.0', }; }); diff --git a/test/unit/client/checks/config/brokerClientVersionSkipDevLocalVersionCheck.test.ts b/test/unit/client/checks/config/brokerClientVersionSkipDevLocalVersionCheck.test.ts index 2e9908ab5..6e26a4d1c 100644 --- a/test/unit/client/checks/config/brokerClientVersionSkipDevLocalVersionCheck.test.ts +++ b/test/unit/client/checks/config/brokerClientVersionSkipDevLocalVersionCheck.test.ts @@ -12,9 +12,7 @@ jest.mock('../../../../../lib/common/utils/version', () => { return { __esModule: true, ...originalModule, - default: () => { - return 'local'; - }, + default: 'local', }; });