diff --git a/src/repositories/RedisNotificationRepository.ts b/src/repositories/RedisNotificationRepository.ts index a1522ed..76d5765 100644 --- a/src/repositories/RedisNotificationRepository.ts +++ b/src/repositories/RedisNotificationRepository.ts @@ -22,7 +22,7 @@ export class RedisNotificationRepository implements NotificationRepository { } get isReady() { - return this.redisClient.isReady + return this.redisClient.isReady; } public async connect() { @@ -33,6 +33,10 @@ export class RedisNotificationRepository implements NotificationRepository { await this.redisClient.disconnect(); } + public async clearAllData() { + await this.redisClient.flushAll(); + } + public async addOrUpdateNotification(notification: ScheduledNotification): Promise { } diff --git a/test/repositories/NotificationRepositorySharedTests.test.ts b/test/repositories/NotificationRepositorySharedTests.test.ts index 282776a..6205833 100644 --- a/test/repositories/NotificationRepositorySharedTests.test.ts +++ b/test/repositories/NotificationRepositorySharedTests.test.ts @@ -28,6 +28,7 @@ class RedisNotificationRepositoryHolder implements RepositoryHolder { } teardown = async () => { if (this.repo) { + await this.repo.clearAllData(); await this.repo.disconnect(); } }