test: add test to verify that a sorted set is automatically deleted if its last element is removed

This commit is contained in:
Julian Lam
2022-02-07 14:47:50 -05:00
parent 0823992d63
commit 8908c7a69a

View File

@@ -1085,6 +1085,11 @@ describe('Sorted Set methods', () => {
});
});
it('should not think the sorted set exists if the last element is removed', async () => {
await db.sortedSetRemove('sorted3', 'value1');
assert.strictEqual(await db.exists('sorted3'), false);
});
it('should remove multiple values from multiple keys', (done) => {
db.sortedSetAdd('multiTest1', [1, 2, 3, 4], ['one', 'two', 'three', 'four'], (err) => {
assert.ifError(err);