From 436e75e3e6fbca5c4cc930eafd2d6c7bfa08ed4f Mon Sep 17 00:00:00 2001 From: Michael C Date: Wed, 22 Feb 2023 01:15:49 -0500 Subject: [PATCH] add explicit test checks in reset --- test/utils/reset.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils/reset.ts b/test/utils/reset.ts index dc31aa91..be025b76 100644 --- a/test/utils/reset.ts +++ b/test/utils/reset.ts @@ -6,14 +6,14 @@ import { Pool } from "pg"; import { Logger } from "../../src/utils/logger"; export async function resetRedis() { - if (config?.redis?.enabled) { + if (config?.redis?.enabled && config.mode === "test") { const client = createClient(config.redis); await client.connect(); await client.flushAll(); } } export async function resetPostgres() { - if (process.env.TEST_POSTGRES && config.postgres) { + if (process.env.TEST_POSTGRES && config.mode == "test" && config.postgres) { const pool = new Pool({ ...config.postgres }); await pool.query(`DROP DATABASE IF EXISTS "sponsorTimes"`); await pool.query(`DROP DATABASE IF EXISTS "privateDB"`);