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

This commit is contained in:
2019-12-22 19:39:25 +03:00
parent 2dcbd1bafc
commit 8b0ec9b1a1

View File

@@ -22,9 +22,13 @@ const test: IConfig = {
...production,
jwtSecret: "TESTSECRET",
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()),
process.env.NODE_ENV === "test"
? process.env.CI
? JSON.parse(fs.readFileSync("./ormconfig.ci.json").toString())
: JSON.parse(
fs.readFileSync("./ormconfig.test.json").toString(),
)
: null,
};
const envs: { [key: string]: IConfig } = { production, development, test };