From 104f0da877c511d1cd08094603dbb894e9b36352 Mon Sep 17 00:00:00 2001 From: aelassas Date: Wed, 1 May 2024 23:38:35 +0100 Subject: [PATCH] Update index.test.ts --- api/tests/index.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/api/tests/index.test.ts b/api/tests/index.test.ts index 62b036a1..0deac8a7 100644 --- a/api/tests/index.test.ts +++ b/api/tests/index.test.ts @@ -55,7 +55,11 @@ describe('Test database initialization', () => { if (tokenIndex) { const { expireAfterSeconds } = tokenIndex - await Token.collection.dropIndex(tokenIndex.name) + try { + await Token.collection.dropIndex(tokenIndex.name) + } catch (err) { + console.log('Error while dropping Booking.expireAt TTL index') + } await createTokenIndex(expireAfterSeconds + 1) await delay() res = await databaseHelper.initialize() @@ -69,7 +73,11 @@ describe('Test database initialization', () => { if (bookingIndex) { const { expireAfterSeconds } = bookingIndex - await Booking.collection.dropIndex(bookingIndex.name) + try { + await Booking.collection.dropIndex(bookingIndex.name) + } catch (err) { + console.log('Error while dropping Booking.expireAt TTL index') + } await createBookingIndex(expireAfterSeconds + 1) await delay() res = await databaseHelper.initialize()