have teardown clear all data in redis before starting next test

This commit is contained in:
2025-03-31 20:21:09 -07:00
parent 9efd1d9289
commit 39066b88bc
2 changed files with 6 additions and 1 deletions

View File

@@ -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<void> {
}

View File

@@ -28,6 +28,7 @@ class RedisNotificationRepositoryHolder implements RepositoryHolder {
}
teardown = async () => {
if (this.repo) {
await this.repo.clearAllData();
await this.repo.disconnect();
}
}