Skip to content

Commit

Permalink
Fix issue where tests would fail when no config.json exists
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Mar 5, 2024
1 parent 8242c5a commit 9efd963
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ let configUser = {}
try {
configUser = JSON.parse(fs.readFileSync(configFilePath))
} catch(error) {
console.error(`Warning: Could not load configuration file from ${configFilePath}. Please check whether it is valid JSON and restart the application.`)
process.exit(1)
if (env !== "test") {
console.error(`Warning: Could not load configuration file from ${configFilePath}. Please check whether it is valid JSON and restart the application.`)
process.exit(1)
}
}
if (env == "test") {
configUser = _.pick(configUser, ["mongo"])
Expand Down

0 comments on commit 9efd963

Please sign in to comment.