mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
closes #5571
This commit is contained in:
@@ -324,6 +324,22 @@ describe('Sorted Set methods', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not error if key is undefined', function (done) {
|
||||
db.sortedSetScore(undefined, 1, function (err, score) {
|
||||
assert.ifError(err);
|
||||
assert.strictEqual(score, null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not error if value is undefined', function (done) {
|
||||
db.sortedSetScore('sortedSetTest1', undefined, function (err, score) {
|
||||
assert.ifError(err);
|
||||
assert.strictEqual(score, null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('sortedSetsScore()', function () {
|
||||
@@ -335,6 +351,15 @@ describe('Sorted Set methods', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return scores even if some keys are undefined', function (done) {
|
||||
db.sortedSetsScore(['sortedSetTest1', undefined, 'doesnotexist'], 'value1', function (err, scores) {
|
||||
assert.equal(err, null);
|
||||
assert.equal(arguments.length, 2);
|
||||
assert.deepEqual(scores, [1.1, null, null]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('sortedSetScores()', function () {
|
||||
@@ -358,6 +383,15 @@ describe('Sorted Set methods', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return scores even if some values are undefined', function (done) {
|
||||
db.sortedSetScores('sortedSetTest1', ['value2', undefined, 'doesnotexist'], function (err, scores) {
|
||||
assert.equal(err, null);
|
||||
assert.equal(arguments.length, 2);
|
||||
assert.deepEqual(scores, [1.2, null, null]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('isSortedSetMember()', function () {
|
||||
|
||||
Reference in New Issue
Block a user