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)); });