mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add call to connect method in factory
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user