diff --git a/test/repositories/NotificationRepositorySharedTests.test.ts b/test/repositories/NotificationRepositorySharedTests.test.ts index 5216224..350ae53 100644 --- a/test/repositories/NotificationRepositorySharedTests.test.ts +++ b/test/repositories/NotificationRepositorySharedTests.test.ts @@ -6,19 +6,23 @@ import { RedisNotificationRepository } from "../../src/repositories/RedisNotific const repositoryImplementations = [ { name: 'InMemoryNotificationRepository', - factory: () => new InMemoryNotificationRepository(), + factory: async () => new InMemoryNotificationRepository(), }, { name: 'RedisNotificationRepository', - factory: () => new RedisNotificationRepository(), + factory: async () => { + const repo = new RedisNotificationRepository(); + await repo.connect(); + return repo; + }, }, ] describe.each(repositoryImplementations)('$name', ({ factory }) => { let repo: NotificationRepository; - beforeEach(() => { - repo = factory(); + beforeEach(async () => { + repo = await factory(); }); const notification = {