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 = [
|
const repositoryImplementations = [
|
||||||
{
|
{
|
||||||
name: 'InMemoryNotificationRepository',
|
name: 'InMemoryNotificationRepository',
|
||||||
factory: () => new InMemoryNotificationRepository(),
|
factory: async () => new InMemoryNotificationRepository(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'RedisNotificationRepository',
|
name: 'RedisNotificationRepository',
|
||||||
factory: () => new RedisNotificationRepository(),
|
factory: async () => {
|
||||||
|
const repo = new RedisNotificationRepository();
|
||||||
|
await repo.connect();
|
||||||
|
return repo;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
describe.each(repositoryImplementations)('$name', ({ factory }) => {
|
describe.each(repositoryImplementations)('$name', ({ factory }) => {
|
||||||
let repo: NotificationRepository;
|
let repo: NotificationRepository;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(async () => {
|
||||||
repo = factory();
|
repo = await factory();
|
||||||
});
|
});
|
||||||
|
|
||||||
const notification = {
|
const notification = {
|
||||||
|
|||||||
Reference in New Issue
Block a user