fix ormconfig.test.json being read even when not in test environment

This commit is contained in:
2019-12-22 19:35:16 +03:00
parent fb9444a389
commit 384c719570

View File

@@ -21,9 +21,10 @@ const development: IConfig = {
const test: IConfig = {
...production,
jwtSecret: "TESTSECRET",
dbConnectionOptions: process.env.CI
? JSON.parse(fs.readFileSync("./ormconfig.ci.json").toString())
: JSON.parse(fs.readFileSync("./ormconfig.test.json").toString()),
dbConnectionOptions:
process.env.NODE_ENV === "test" && process.env.CI
? JSON.parse(fs.readFileSync("./ormconfig.ci.json").toString())
: JSON.parse(fs.readFileSync("./ormconfig.test.json").toString()),
};
const envs: { [key: string]: IConfig } = { production, development, test };