Skip to content

Commit

Permalink
Explicitly declare application name in applicationInfo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Patrick Fleming committed Nov 29, 2024
1 parent bba1e15 commit a5e51a8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/applicationInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fs from 'fs'
import path from 'path'
import config from './config'

const { buildNumber, gitRef, productId, branchName } = config
Expand All @@ -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 }
}

0 comments on commit a5e51a8

Please sign in to comment.