From ab02271245c1886792e64c76a4549390c6221daa Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Wed, 30 Oct 2024 14:55:41 +0300 Subject: [PATCH] check if the merged calendars directory exists befor cleaning it up after tests --- calendar.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/calendar.test.js b/calendar.test.js index 72f4ed6..f7b9e07 100644 --- a/calendar.test.js +++ b/calendar.test.js @@ -22,7 +22,9 @@ describe('Calendar Merging API', () => { afterAll( async () => { // Clean up the merged calendars directory after tests - fs.rmdirSync(MERGED_CALENDARS_DIR, { recursive: true }); + if (fs.existsSync(MERGED_CALENDARS_DIR)) { + fs.rmdirSync(MERGED_CALENDARS_DIR, { recursive: true }); + } }); test('Merge date-based calendar', async () => {