Skip to content

Commit

Permalink
ignore command line args under test
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Nov 23, 2024
1 parent 6bf18c8 commit 00c4033
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ Sentry.init({
},
})

if (+process.argv[2]) {
config.public.bind.port = +process.argv[2]
}
if (process.argv[3]) {
config.public.bind.address = process.argv[3]
if (process.env.NODE_CONFIG_ENV !== 'test') {
if (+process.argv[2]) {
config.public.bind.port = +process.argv[2]
}
if (process.argv[3]) {
config.public.bind.address = process.argv[3]
}
}

console.log('Configuration:')
Expand Down Expand Up @@ -64,6 +66,7 @@ if (fs.existsSync(legacySecretsPath)) {
}

async function startServer() {
console.log(config)
const server = new Server(config)
await server.start()
return server
Expand Down

0 comments on commit 00c4033

Please sign in to comment.