dont return undefined from sortedSetsCard if keys is empty or falsy

This commit is contained in:
Baris Usakli
2018-12-07 16:50:35 -05:00
parent 76af8caf58
commit e65d40c937
4 changed files with 21 additions and 3 deletions

View File

@@ -331,6 +331,24 @@ describe('Sorted Set methods', function () {
done();
});
});
it('should return empty array if keys is falsy', function (done) {
db.sortedSetsCard(undefined, function (err, counts) {
assert.ifError(err);
assert.equal(arguments.length, 2);
assert.deepEqual(counts, []);
done();
});
});
it('should return empty array if keys is empty array', function (done) {
db.sortedSetsCard([], function (err, counts) {
assert.ifError(err);
assert.equal(arguments.length, 2);
assert.deepEqual(counts, []);
done();
});
});
});
describe('sortedSetRank()', function () {