add setup for repository tests

This commit is contained in:
2025-03-31 19:43:17 -07:00
parent 36359a4caa
commit a7ac9888f6

View File

@@ -0,0 +1,22 @@
import { afterEach, beforeEach, describe } from "@jest/globals";
import { createClient, RedisClientType } from "redis";
import { RedisNotificationRepository } from "../../src/repositories/RedisNotificationRepository";
describe("RedisNotificationRepository", () => {
let redisClient: RedisClientType;
let repository: RedisNotificationRepository;
beforeEach(async () => {
redisClient = createClient({
url: process.env.REDIS_URL,
});
repository = new RedisNotificationRepository(
redisClient
);
await repository.connect();
});
afterEach(async () => {
await repository.disconnect();
})
});