From 68c9096e9bc6cd1d44c423103b64f629b281d49e Mon Sep 17 00:00:00 2001 From: jinalviranii Date: Mon, 9 Sep 2024 12:02:58 +0530 Subject: [PATCH] Fix test case --- spec/tests/storage/redis_storage.spec.js | 40 ------------------------ 1 file changed, 40 deletions(-) delete mode 100644 spec/tests/storage/redis_storage.spec.js diff --git a/spec/tests/storage/redis_storage.spec.js b/spec/tests/storage/redis_storage.spec.js deleted file mode 100644 index 9e34347d..00000000 --- a/spec/tests/storage/redis_storage.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -const RedisStorage = require('../../../lib/storage/redis_storage'); -const Redis = require('ioredis'); -const redisConnection = new Redis("localhost"); - -describe('Redis Storage', () => { - let redisStorage; - - beforeAll(() => { - redisStorage = new RedisStorage(redisConnection, 'testPrefix'); - }); - - it('Should set and get a value', async () => { - await redisStorage.set('key1', 'value1'); - const result = await redisStorage.get('key1'); - expect(result).toBe('value1'); - }); - - it('Should set and delete a value', async () => { - await redisStorage.set('key2', 'value2'); - await redisStorage.del('key2'); - const result = await redisStorage.get('key2'); - expect(result).toBeNull(); - }); - - it('Should set and get a hash value', async () => { - await redisStorage.hset('hashKey', 'nestedKey', 'nestedValue'); - const result = await redisStorage.hget('hashKey', 'nestedKey'); - expect(result).toBe('nestedValue'); - }); - - it('Should handle non-existent hash key in hget', async () => { - const result = await redisStorage.hget('nonExistentKey', 'nonExistentNestedKey'); - expect(result).toBeNull(); - }); - - it('Should handle non-existent key in hgetall', async () => { - const result = await redisStorage.hgetall('nonExistentKey'); - expect(result).toEqual({}); - }); -});