mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
have teardown clear all data in redis before starting next test
This commit is contained in:
@@ -22,7 +22,7 @@ export class RedisNotificationRepository implements NotificationRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isReady() {
|
get isReady() {
|
||||||
return this.redisClient.isReady
|
return this.redisClient.isReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async connect() {
|
public async connect() {
|
||||||
@@ -33,6 +33,10 @@ export class RedisNotificationRepository implements NotificationRepository {
|
|||||||
await this.redisClient.disconnect();
|
await this.redisClient.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async clearAllData() {
|
||||||
|
await this.redisClient.flushAll();
|
||||||
|
}
|
||||||
|
|
||||||
public async addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
|
public async addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class RedisNotificationRepositoryHolder implements RepositoryHolder {
|
|||||||
}
|
}
|
||||||
teardown = async () => {
|
teardown = async () => {
|
||||||
if (this.repo) {
|
if (this.repo) {
|
||||||
|
await this.repo.clearAllData();
|
||||||
await this.repo.disconnect();
|
await this.repo.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user