yeahoffline / redis-mock

Node.js redis client mock
213 stars 111 forks source link

Fix callback issue #123

Closed K-JBoon closed 5 years ago

K-JBoon commented 5 years ago

When doing a promisified client.get, redis-mock fails with:

/node_modules/redis-mock/lib/redis-mock.js:424
                  callback(err, "OK");
                  ^

TypeError: callback is not a function
    at /node_modules/redis-mock/lib/redis-mock.js:424:19
    at /node_modules/redis-mock/lib/redis-mock.js:86:9
    at processTicksAndRejections (internal/process/next_tick.js:74:9)

Resolved by using the _callCallback wrapper to make sure the callback is actually a function