Open seanlion opened 2 years ago
A workaround for returning values to use jest mock functions. I think it would be helpful for users who wants to integrate with jest.
var redis_client = require("redis-mock") jest.fn().mockImplementation(async (args) => { const result = await new Promise((resolve, reject) => { redis_client.command(args, function(err,result) { resolve(result); }); }); return result; });
Overview
A workaround for returning values to use jest mock functions. I think it would be helpful for users who wants to integrate with jest.
Usage