diff --git a/test/auth.spec.js b/test/auth.spec.js index 5dee3d83a3..c049df5d30 100644 --- a/test/auth.spec.js +++ b/test/auth.spec.js @@ -36,7 +36,7 @@ describe("client authentication", function () { client = redis.createClient.apply(redis.createClient, args); client.once('error', function (error) { - assert.ok(/ERR invalid password/.test(error)) + assert.ok(/ERR invalid password/.test(error)); return done(); }); @@ -47,7 +47,8 @@ describe("client authentication", function () { it('allows auth to be provided as part of redis url', function (done) { client = redis.createClient('redis://foo:' + auth + '@' + config.HOST[ip] + ':' + config.PORT); client.on("ready", function () { - return done() }); + return done(); + }); }); } diff --git a/test/commands/client.spec.js b/test/commands/client.spec.js index a9188cdac9..50d0f4899f 100644 --- a/test/commands/client.spec.js +++ b/test/commands/client.spec.js @@ -19,11 +19,10 @@ describe("The 'client' method", function () { client.once("connect", function () { client.flushdb(function (err) { if (!helper.serverVersionAtLeast(client, [2, 4, 0])) { - err = Error('script not supported in redis <= 2.4.0') + err = Error('script not supported in redis <= 2.4.0'); } return done(err); - - }) + }); }); }); @@ -39,15 +38,15 @@ describe("The 'client' method", function () { it("lists connected clients when invoked with multi's chaining syntax", function (done) { client.multi().client("list").exec(function(err, results) { assert(pattern.test(results[0]), "expected string '" + results + "' to match " + pattern.toString()); - return done() - }) + return done(); + }); }); it("lists connected clients when invoked with multi's array syntax", function (done) { client.multi().client("list").exec(function(err, results) { assert(pattern.test(results[0]), "expected string '" + results + "' to match " + pattern.toString()); - return done() - }) + return done(); + }); }); }); }); diff --git a/test/commands/eval.spec.js b/test/commands/eval.spec.js index 229e9c51b0..0c3edb08fa 100644 --- a/test/commands/eval.spec.js +++ b/test/commands/eval.spec.js @@ -19,10 +19,10 @@ describe("The 'eval' method", function () { client.once("connect", function () { client.flushdb(function (err) { if (!helper.serverVersionAtLeast(client, [2, 5, 0])) { - err = Error('exec not supported in redis <= 2.5.0') + err = Error('exec not supported in redis <= 2.5.0'); } return done(err); - }) + }); }); }); diff --git a/test/commands/hmset.spec.js b/test/commands/hmset.spec.js index 6b6f980aa9..859f0c26ab 100644 --- a/test/commands/hmset.spec.js +++ b/test/commands/hmset.spec.js @@ -27,7 +27,7 @@ describe("The 'hmset' method", function () { assert.equal(obj['0123456789'], 'abcdefghij'); assert.equal(obj['some manner of key'], 'a type of value'); return done(err); - }) + }); }); it('handles object-style syntax', function (done) { @@ -36,7 +36,7 @@ describe("The 'hmset' method", function () { assert.equal(obj['0123456789'], 'abcdefghij'); assert.equal(obj['some manner of key'], 'a type of value'); return done(err); - }) + }); }); it('handles object-style syntax and the key being a number', function (done) { diff --git a/test/commands/hset.spec.js b/test/commands/hset.spec.js index 9f55606f35..7155e3297d 100644 --- a/test/commands/hset.spec.js +++ b/test/commands/hset.spec.js @@ -47,11 +47,11 @@ describe("The 'hset' method", function () { }); it('does not error when a buffer and array are set as fields on the same hash', function (done) { - var hash = "test hash" - var field1 = "buffer" - var value1 = new Buffer("abcdefghij") - var field2 = "array" - var value2 = ["array contents"] + var hash = "test hash"; + var field1 = "buffer"; + var value1 = new Buffer("abcdefghij"); + var field2 = "array"; + var value2 = ["array contents"]; client.HMSET(hash, field1, value1, field2, value2, helper.isString("OK", done)); }); diff --git a/test/commands/multi.spec.js b/test/commands/multi.spec.js index 651389e6ce..41ae51f075 100644 --- a/test/commands/multi.spec.js +++ b/test/commands/multi.spec.js @@ -50,7 +50,7 @@ describe("The 'multi' method", function () { client.once("connect", function () { client.flushdb(function (err) { return done(err); - }) + }); }); }); diff --git a/test/commands/renamenx.spec.js b/test/commands/renamenx.spec.js index 57eb6dab07..454d046727 100644 --- a/test/commands/renamenx.spec.js +++ b/test/commands/renamenx.spec.js @@ -32,7 +32,7 @@ describe("The 'renamenx' method", function () { client.renamenx('foo', 'foo2', helper.isNumber(0)); client.exists('foo', helper.isNumber(1)); client.exists(['foo2'], helper.isNumber(1, done)); - }) + }); afterEach(function () { client.end(); diff --git a/test/commands/script.spec.js b/test/commands/script.spec.js index 507c0befb3..254ab6045f 100644 --- a/test/commands/script.spec.js +++ b/test/commands/script.spec.js @@ -21,11 +21,10 @@ describe("The 'script' method", function () { client.once("connect", function () { client.flushdb(function (err) { if (!helper.serverVersionAtLeast(client, [2, 6, 0])) { - err = Error('script not supported in redis <= 2.6.0') + err = Error('script not supported in redis <= 2.6.0'); } return done(err); - - }) + }); }); }); @@ -42,21 +41,21 @@ describe("The 'script' method", function () { it('allows a loaded script to be evaluated', function (done) { client.evalsha(commandSha, 0, helper.isString('99', done)); - }) + }); it('allows a script to be loaded as part of a chained transaction', function (done) { client.multi().script("load", command).exec(function(err, result) { assert.strictEqual(result[0], commandSha); - return done() - }) - }) + return done(); + }); + }); it("allows a script to be loaded using a transaction's array syntax", function (done) { client.multi([['script', 'load', command]]).exec(function(err, result) { assert.strictEqual(result[0], commandSha); - return done() - }) - }) + return done(); + }); + }); }); }); }); diff --git a/test/commands/select.spec.js b/test/commands/select.spec.js index 25f45f5d53..bdc87668d1 100644 --- a/test/commands/select.spec.js +++ b/test/commands/select.spec.js @@ -70,7 +70,7 @@ describe("The 'select' method", function () { it("emits an error", function (done) { assert.strictEqual(client.selected_db, null, "default db should be null"); client.select(9999, function (err) { - assert.equal(err.message, 'ERR invalid DB index') + assert.equal(err.message, 'ERR invalid DB index'); return done(); }); }); diff --git a/test/commands/sort.spec.js b/test/commands/sort.spec.js index 868d26a7f2..d50f176b64 100644 --- a/test/commands/sort.spec.js +++ b/test/commands/sort.spec.js @@ -17,7 +17,7 @@ describe("The 'sort' method", function () { client.once("error", done); client.once("connect", function () { client.flushdb(); - setupData(client, done) + setupData(client, done); }); }); diff --git a/test/commands/watch.spec.js b/test/commands/watch.spec.js index 355f31b9b9..6cbc63e2f4 100644 --- a/test/commands/watch.spec.js +++ b/test/commands/watch.spec.js @@ -20,11 +20,10 @@ describe("The 'watch' method", function () { client.once("connect", function () { client.flushdb(function (err) { if (!helper.serverVersionAtLeast(client, [2, 2, 0])) { - err = Error('some watch commands not supported in redis <= 2.2.0') + err = Error('some watch commands not supported in redis <= 2.2.0'); } return done(err); - - }) + }); }); }); @@ -38,7 +37,7 @@ describe("The 'watch' method", function () { var multi = client.multi(); multi.incr(watched); multi.exec(helper.isNull(done)); - }) + }); it('successfully modifies other keys independently of transaction', function (done) { client.set("unwatched", 200); diff --git a/test/helper.js b/test/helper.js index 30fc7b24e8..36878f6516 100644 --- a/test/helper.js +++ b/test/helper.js @@ -20,7 +20,7 @@ if (!process.env.REDIS_TESTS_STARTED) { before(function (done) { startRedis('./conf/redis.conf', done); - }) + }); after(function (done) { if (rp) rp.stop(done); diff --git a/test/lib/config.js b/test/lib/config.js index c80a8f9420..d42dc21c9a 100644 --- a/test/lib/config.js +++ b/test/lib/config.js @@ -16,7 +16,7 @@ var config = { opts = opts || {}; if (ip.match(/\.sock/)) { - args.push(ip) + args.push(ip); } else { args.push(config.PORT); args.push(config.HOST[ip]); diff --git a/test/lib/redis-process.js b/test/lib/redis-process.js index fbf176d592..176aa2e052 100644 --- a/test/lib/redis-process.js +++ b/test/lib/redis-process.js @@ -58,7 +58,7 @@ module.exports = { } waitForRedis(false, function () { return done(error); - }) + }); }); rp.kill("SIGTERM"); } diff --git a/test/lib/unref.js b/test/lib/unref.js index 46b03643a3..45877a493e 100644 --- a/test/lib/unref.js +++ b/test/lib/unref.js @@ -5,8 +5,8 @@ var redis = require("../../"); var HOST = process.argv[2] || '127.0.0.1'; -var PORT = process.argv[3] -var args = PORT ? [PORT, HOST] : [HOST] +var PORT = process.argv[3]; +var args = PORT ? [PORT, HOST] : [HOST]; var c = redis.createClient.apply(redis, args); c.unref(); diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 999b11f404..e505878314 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -3,7 +3,7 @@ var async = require("async"); var assert = require("assert"); var config = require("./lib/config"); -var helper = require('./helper') +var helper = require('./helper'); var fork = require("child_process").fork; var redis = config.redis; @@ -110,7 +110,7 @@ describe("The node_redis client", function () { client = redis.createClient.apply(redis.createClient, args); client.once("error", done); client.once("connect", function () { - client.flushdb(done) + client.flushdb(done); }); }); @@ -124,23 +124,19 @@ 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")(err, res); - cb(); + helper.isString("one", cb)(err, res); }); }, function (cb) { client.get("recon 1", function (err, res) { - helper.isString("one")(err, res); - cb(); + helper.isString("one", cb)(err, res); }); }, function (cb) { client.get("recon 2", function (err, res) { - helper.isString("two")(err, res); - cb(); + helper.isString("two", cb)(err, res); }); }, function (cb) { client.get("recon 2", function (err, res) { - helper.isString("two")(err, res); - cb(); + helper.isString("two", cb)(err, res); }); }], function (err, results) { client.removeListener("connect", on_connect); @@ -266,7 +262,7 @@ describe("The node_redis client", function () { // this is the expected and desired behavior domain.on('error', function (err) { domain.exit(); - return done() + return done(); }); } }); @@ -680,7 +676,7 @@ describe("The node_redis client", function () { }); it("sets upper bound on how long client waits before reconnecting", function (done) { - var time = new Date().getTime() + var time = new Date().getTime(); var reconnecting = false; client = redis.createClient.apply(redis.createClient, args); diff --git a/test/pubsub.spec.js b/test/pubsub.spec.js index 3a3718b95b..99c75987c7 100644 --- a/test/pubsub.spec.js +++ b/test/pubsub.spec.js @@ -46,7 +46,7 @@ describe("publish/subscribe", function () { it('fires a subscribe event for each channel subscribed to', function (done) { sub.on("subscribe", function (chnl, count) { if (chnl === channel2) { - assert.equal(2, count) + assert.equal(2, count); return done(); } }); @@ -169,7 +169,7 @@ describe("publish/subscribe", function () { describe('unsubscribe', function () { it('fires an unsubscribe event', function (done) { sub.on("subscribe", function (chnl, count) { - sub.unsubscribe(channel) + sub.unsubscribe(channel); }); sub.subscribe(channel); @@ -183,7 +183,7 @@ describe("publish/subscribe", function () { it('puts client back into write mode', function (done) { sub.on("subscribe", function (chnl, count) { - sub.unsubscribe(channel) + sub.unsubscribe(channel); }); sub.subscribe(channel); @@ -191,10 +191,10 @@ describe("publish/subscribe", function () { sub.on("unsubscribe", function (chnl, count) { pub.incr("foo", helper.isNumber(1, done)); }); - }) + }); it('does not complain when unsubscribe is called and there are no subscriptions', function () { - sub.unsubscribe() + sub.unsubscribe(); }); it('executes callback when unsubscribe is called and there are no subscriptions', function (done) { @@ -217,15 +217,15 @@ describe("publish/subscribe", function () { assert.strictEqual(channel, '/foo'); assert.strictEqual(message, 'hello world'); return done(); - }) + }); pub.publish('/foo', 'hello world'); }); }); describe('punsubscribe', function () { it('does not complain when punsubscribe is called and there are no subscriptions', function () { - sub.punsubscribe() - }) + sub.punsubscribe(); + }); it('executes callback when punsubscribe is called and there are no subscriptions', function (done) { // test hangs on older versions of redis, so skip