From f5ff331f2fe4e7484e53c8423e2b6a66d9c099e9 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Wed, 6 Nov 2024 15:20:24 +0300 Subject: [PATCH] fix: Ensure correct merged calendars directory path based on environment - Updated MERGED_CALENDARS_DIR to use path.join for consistent path resolution. - Ensured that the directory is correctly set to 'temp_test_calendar' during tests and 'calendar' in production. --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 9c24fc6..a0177fd 100644 --- a/server.js +++ b/server.js @@ -9,9 +9,9 @@ const app = express(); app.use(express.json()); // Determine the merged calendars directory based on the environment -const MERGED_CALENDARS_DIR = process.env.NODE_ENV === 'test' +const MERGED_CALENDARS_DIR = path.join(__dirname, process.env.NODE_ENV === 'test' ? 'temp_test_calendar' - : 'calendar'; + : 'calendar'); console.log(`Merged calendars directory: ${MERGED_CALENDARS_DIR}`);