You've already forked node-redis
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:
@@ -121,7 +121,7 @@ describe("The 'client' method", function () {
|
||||
var client2;
|
||||
|
||||
beforeEach(function (done) {
|
||||
client2 = redis.createClient.apply(redis.createClient, args);
|
||||
client2 = redis.createClient.apply(null, args);
|
||||
client2.once('ready', function () {
|
||||
done();
|
||||
});
|
||||
@@ -136,9 +136,9 @@ describe("The 'client' method", function () {
|
||||
// per chunk. So the execution order is only garanteed on each client
|
||||
var end = helper.callFuncAfter(done, 2);
|
||||
|
||||
client.client('setname', 'RUTH', helper.isString('OK'));
|
||||
client2.client('setname', 'RENEE', helper.isString('OK'));
|
||||
client2.client('setname', 'MARTIN', helper.isString('OK'));
|
||||
client.client('setname', 'RUTH');
|
||||
client2.client('setname', ['RENEE'], helper.isString('OK'));
|
||||
client2.client(['setname', 'MARTIN'], helper.isString('OK'));
|
||||
client2.client('getname', function (err, res) {
|
||||
assert.equal(res, 'MARTIN');
|
||||
end();
|
||||
|
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -39,7 +39,7 @@ describe("The 'hmset' method", function () {
|
||||
});
|
||||
|
||||
it('handles object-style syntax and the key being a number', function (done) {
|
||||
client.HMSET(231232, {'0123456789': 'abcdefghij', 'some manner of key': 'a type of value', 'otherTypes': 555}, helper.isString('OK'));
|
||||
client.HMSET(231232, {'0123456789': 'abcdefghij', 'some manner of key': 'a type of value', 'otherTypes': 555}, undefined);
|
||||
client.HGETALL(231232, function (err, obj) {
|
||||
assert.equal(obj['0123456789'], 'abcdefghij');
|
||||
assert.equal(obj['some manner of key'], 'a type of value');
|
||||
|
Reference in New Issue
Block a user