From 869beeb3d46715bca6686835b173b8f3bb57ef87 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Wed, 27 Nov 2024 13:24:14 +0300 Subject: [PATCH] test(calendar): clean up merged calendars directory after tests --- test/calendar.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/calendar.test.js b/test/calendar.test.js index 5c89aac..79c48a2 100644 --- a/test/calendar.test.js +++ b/test/calendar.test.js @@ -25,6 +25,12 @@ describe('Calendar Merging API', () => { // Ensure the server is closed before cleanup await new Promise(resolve => server.close(resolve)); + // Clean up the merged calendars directory after tests + fs.rmdirSync(CALENDARS_DIR, { recursive: true }); + if (fs.existsSync(CALENDARS_DIR)) { + fs.rmdirSync(CALENDARS_DIR, { recursive: true }); + } + // Optional: Add a delay to ensure all handles are released await new Promise(resolve => setTimeout(resolve, 100)); });