From ba779ac361d9128d8ab98e3b7792a51eb285e593 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 1 Sep 2015 21:45:54 +0200 Subject: [PATCH] Some small code style changes Revert some done stuff --- index.js | 2 +- test/commands/mset.spec.js | 6 +++--- test/node_redis.spec.js | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 2466130d8f..910b5bcf91 100644 --- a/index.js +++ b/index.js @@ -955,7 +955,7 @@ RedisClient.prototype.select = function (db, callback) { if (err === null) { self.selected_db = db; } - if (typeof(callback) === 'function') { + if (typeof callback === 'function') { callback(err, res); } else if (err) { self.emit('error', err); diff --git a/test/commands/mset.spec.js b/test/commands/mset.spec.js index 950e6870a6..e8348713ca 100644 --- a/test/commands/mset.spec.js +++ b/test/commands/mset.spec.js @@ -88,9 +88,9 @@ describe("The 'mset' method", function () { describe("and no callback is specified", function () { describe("with valid parameters", function () { it("sets the value correctly", function (done) { - client.mset(key, value, key2, value2); - client.get(key, helper.isString(value)); - client.get(key2, helper.isString(value2, done)); + client.mset(key, value2, key2, value); + client.get(key, helper.isString(value2)); + client.get(key2, helper.isString(value, done)); }); }); diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index e505878314..ea792b946a 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -124,19 +124,23 @@ describe("The node_redis client", function () { client.on("connect", function on_connect() { async.parallel([function (cb) { client.get("recon 1", function (err, res) { - helper.isString("one", cb)(err, res); + helper.isString("one")(err, res); + cb(); }); }, function (cb) { client.get("recon 1", function (err, res) { - helper.isString("one", cb)(err, res); + helper.isString("one")(err, res); + cb(); }); }, function (cb) { client.get("recon 2", function (err, res) { - helper.isString("two", cb)(err, res); + helper.isString("two")(err, res); + cb(); }); }, function (cb) { client.get("recon 2", function (err, res) { - helper.isString("two", cb)(err, res); + helper.isString("two")(err, res); + cb(); }); }], function (err, results) { client.removeListener("connect", on_connect);