Skip to content

Commit

Permalink
Update index.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed May 1, 2024
1 parent f660d4f commit 104f0da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 104f0da

Please sign in to comment.