async-redis
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"private": false, | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"name": "async-redis", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,4 +14,9 @@ /* eslint func-names: ["error", "as-needed"] */ | ||
// this is the set of commands to NOT promisify | ||
const commandsToSkipSet = new Set(['multi']); | ||
// this is the set of commands to promisify | ||
const commandSet = new Set(commands.filter(c => !commandsToSkipSet.has(c))); | ||
AsyncRedis.decorate = redisClient => objectDecorator(redisClient, (name, method) => { | ||
if (commands.includes(name)) { | ||
if (commandSet.has(name)) { | ||
return (...args) => new Promise((resolve, reject) => { | ||
@@ -18,0 +23,0 @@ args.push((error, ...results) => { |
@@ -57,2 +57,10 @@ const { assert } = require('chai'); | ||
}); | ||
describe('test multi not a promise', function () { | ||
it('should be not equal', async () => { | ||
let notAPromise = redisClient.multi(); | ||
console.log(notAPromise); | ||
assert.notEqual(Promise.resolve(notAPromise), notAPromise); | ||
}); | ||
}); | ||
}); |
104783
214