Open harrytwright opened 2 years ago
A workaround using the premise of #163 to add custom commands. Comes with updated tests, but haven't ran it against the new node-redis
var redis = require("redis-mock") redis.addMockCommand('json.set', (client, args, callback) => { // your logic here client.set(args[0], JSON.stringify(args[2]), callback) }) // In your app redis.addCommand('json.set') var client = redis.createClient() client.json_set('key', '.', { json: 'value' }, redis.print) // 0 'OK'
Overview
A workaround using the premise of #163 to add custom commands. Comes with updated tests, but haven't ran it against the new node-redis
Usage