fix: tests on redis

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 8bf980cb63
commit 7a801abade

@ -154,6 +154,9 @@ module.exports = function (module) {
};
module.deleteObjectFields = async function (key, fields) {
if (!Array.isArray(fields) || !fields.length) {
return;
}
await module.client.async.hdel(key, fields);
cache.delObjectCache(key);
};

@ -410,6 +410,10 @@ describe('Hash methods', function () {
});
});
it('should not error if fields is empty array', async () => {
await db.deleteObjectFields('someKey', []);
});
it('should not error if key is undefined', function (done) {
db.deleteObjectField(undefined, 'someField', function (err) {
assert.ifError(err);

Loading…
Cancel
Save