From a7ac9888f68f28e871d56af22deb125a4d58514e Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 31 Mar 2025 19:43:17 -0700 Subject: [PATCH] add setup for repository tests --- .../RedisNotificationRepositoryTests.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/repositories/RedisNotificationRepositoryTests.test.ts diff --git a/test/repositories/RedisNotificationRepositoryTests.test.ts b/test/repositories/RedisNotificationRepositoryTests.test.ts new file mode 100644 index 0000000..0eb4a92 --- /dev/null +++ b/test/repositories/RedisNotificationRepositoryTests.test.ts @@ -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(); + }) +});