Hi i have a test in which i want to mock redis and then get this values.
I installed redis-mock npm package and in jest test i want to do something like this:
import redis from 'redis-mock';
describe('test', () => {
const redisClient = redis.createClient();
redis.set('key', 'myKeyValue')
it ('should do sth', async () => {
const redisValue = redis.get('key');
console.log(redisValue);
expect(redisValue).toBe('myKeyValue');
})
)
But this doesn't work. I got undefined value. How to do something like this?