From 5ec42d07bb89b24a6901e86e9c2db636bb386f28 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Mon, 25 Nov 2024 20:00:02 +0300 Subject: [PATCH] Clean up the merged calendars directory before tests --- test/calendar.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/calendar.test.js b/test/calendar.test.js index 79a42a5..edea6d5 100644 --- a/test/calendar.test.js +++ b/test/calendar.test.js @@ -24,6 +24,11 @@ describe('Calendar Merging API', () => { beforeAll(async () => { // Start the server server = app.listen(0); + // Clean up the merged calendars directory before tests + fs.rmdirSync(CALENDARS_DIR, { recursive: true }); + if (fs.existsSync(CALENDARS_DIR)) { + fs.rmdirSync(CALENDARS_DIR, { recursive: true }); + } }); afterAll(async () => {