1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Improve coverage; make tests ready for Redis 3.2

Add command sanity check
This commit is contained in:
Ruben Bridgewater
2016-04-21 02:56:06 +02:00
parent eae16938cd
commit ce1678c778
9 changed files with 79 additions and 24 deletions

View File

@@ -28,23 +28,23 @@ describe("The 'hgetall' method", function () {
assert.strictEqual('1', obj.__proto__.toString()); // eslint-disable-line no-proto
assert.strictEqual('23', obj.another.toString());
assert.strictEqual('1234', obj.home.toString());
return done(err);
done(err);
});
});
it('handles fetching keys set using an object', function (done) {
client.HMSET('msg_test', { message: 'hello' }, helper.isString('OK'));
client.batch().HMSET('msg_test', { message: 'hello' }, undefined).exec();
client.hgetall('msg_test', function (err, obj) {
assert.strictEqual(1, Object.keys(obj).length);
assert.strictEqual(obj.message, 'hello');
return done(err);
done(err);
});
});
it('handles fetching a messing key', function (done) {
client.hgetall('missing', function (err, obj) {
assert.strictEqual(null, obj);
return done(err);
done(err);
});
});
});