check if the merged calendars directory exists befor cleaning it up after tests

This commit is contained in:
Ryan Mwangi 2024-10-30 14:55:41 +03:00
parent a61ae491fa
commit ab02271245
1 changed files with 3 additions and 1 deletions

View File

@ -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 () => {