From a5e51a8254bc7fb38e55868306ce1164b557a025 Mon Sep 17 00:00:00 2001 From: Patrick Fleming Date: Fri, 29 Nov 2024 10:24:06 +0000 Subject: [PATCH] Explicitly declare application name in applicationInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pulling this from package.json using relative paths is awkward because when the code is compiled it sits one directory level deeper, so it was causing tests to fail. We could try to do something clever or find a package to give us the project root path, but I don’t think it’s worth it, we may as well just declare the application name explicitly here. --- server/applicationInfo.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/applicationInfo.ts b/server/applicationInfo.ts index 7b7bd49..29c7209 100644 --- a/server/applicationInfo.ts +++ b/server/applicationInfo.ts @@ -1,5 +1,3 @@ -import fs from 'fs' -import path from 'path' import config from './config' const { buildNumber, gitRef, productId, branchName } = config @@ -14,7 +12,6 @@ export type ApplicationInfo = { } export default (): ApplicationInfo => { - const packageJson = path.join(__dirname, '../../package.json') - const { name: applicationName } = JSON.parse(fs.readFileSync(packageJson).toString()) + const applicationName = 'hmpps-community-accommodation-tier-2-bail-ui' return { applicationName, buildNumber, gitRef, gitShortHash: gitRef.substring(0, 7), productId, branchName } }