From 0b46a69c7efd8ee40d93adbc1d61275ba26f0c6f Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Sat, 12 Sep 2015 18:44:01 -0700 Subject: [PATCH] fix merge, run linting as part of the test suite --- package.json | 1 - test/commands/client.spec.js | 2 +- test/commands/eval.spec.js | 2 +- test/commands/multi.spec.js | 34 +--------------------------------- test/helper.js | 2 +- test/lib/redis-process.js | 27 +++------------------------ 6 files changed, 7 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 3999e55..57c99a9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "optional-dev-dependency": "^1.0.1", "tcp-port-used": "^0.1.2", "uuid": "^2.0.1", - "uuid": "^2.0.1", "win-spawn": "^2.0.0" }, "repository": { diff --git a/test/commands/client.spec.js b/test/commands/client.spec.js index d6df117..1d47db7 100644 --- a/test/commands/client.spec.js +++ b/test/commands/client.spec.js @@ -17,7 +17,7 @@ describe("The 'client' method", function () { client = redis.createClient.apply(redis.createClient, args); client.once("error", done); client.once("connect", function () { - client.flushdb(done) + client.flushdb(done); }); }); diff --git a/test/commands/eval.spec.js b/test/commands/eval.spec.js index 184759a..5abdb04 100644 --- a/test/commands/eval.spec.js +++ b/test/commands/eval.spec.js @@ -17,7 +17,7 @@ describe("The 'eval' method", function () { client = redis.createClient.apply(redis.createClient, args); client.once("error", done); client.once("connect", function () { - client.flushdb(done) + client.flushdb(done); }); }); diff --git a/test/commands/multi.spec.js b/test/commands/multi.spec.js index e8be8d0..6d4def8 100644 --- a/test/commands/multi.spec.js +++ b/test/commands/multi.spec.js @@ -89,38 +89,6 @@ describe("The 'multi' method", function () { }); }); -<<<<<<< HEAD - // I'm unclear as to the difference between this test in the test above, - // perhaps @mranney can clarify? - it('roles back a transaction when an error was provoked at queue time', function (done) { - var multi1 = client.multi(); - multi1.mset("multifoo_8", "10", "multibar_8", "20", helper.isString("OK")); - multi1.set("foo2", helper.isError()); - multi1.set("foo3", helper.isError()); - multi1.incr("multifoo_8", helper.isNumber(11)); - multi1.incr("multibar_8", helper.isNumber(21)); - multi1.exec(function () { - // Redis 2.6.5+ will abort transactions with errors - // see: http://redis.io/topics/transactions - var multibar_expected = 22; - var multifoo_expected = 12; - if (helper.serverVersionAtLeast(client, [2, 6, 5])) { - multibar_expected = 1; - multifoo_expected = 1; - } - - // Confirm that the previous command, while containing an error, still worked. - var multi2 = client.multi(); - multi2.incr("multibar_8", helper.isNumber(multibar_expected)); - multi2.incr("multifoo_8", helper.isNumber(multifoo_expected)); - multi2.exec(function (err, replies) { - assert.strictEqual(multibar_expected, replies[0]); - assert.strictEqual(multifoo_expected, replies[1]); - return done(); - }); - }); - }); - it('roles back a transaction when one command in an array of commands fails', function (done) { // test nested multi-bulk replies client.multi([ @@ -227,7 +195,7 @@ describe("The 'multi' method", function () { }); it('reports multiple exceptions when they occur', function (done) { - helper.serverVersionAtLeast.bind(this)(client, [2, 6, 5]) + helper.serverVersionAtLeast.bind(this)(client, [2, 6, 5]); client.multi().set("foo").exec(function (err, reply) { assert(Array.isArray(err), "err should be an array"); diff --git a/test/helper.js b/test/helper.js index 158e837..b31e90e 100644 --- a/test/helper.js +++ b/test/helper.js @@ -112,7 +112,7 @@ module.exports = { var protocols = ['IPv4']; if (process.platform !== 'win32') { parsers.push('hiredis'); - protocols.push('IPv6') + protocols.push('IPv6'); } parsers.forEach(function (parser) { diff --git a/test/lib/redis-process.js b/test/lib/redis-process.js index 6e09ea3..6082648 100644 --- a/test/lib/redis-process.js +++ b/test/lib/redis-process.js @@ -11,6 +11,8 @@ var tcpPortUsed = require('tcp-port-used'); // wait for redis to be listening in // all three modes (ipv4, ipv6, socket). function waitForRedis (available, cb) { + if (process.platform === 'win32') return cb(); + var ipV4 = false; var id = setInterval(function () { tcpPortUsed.check(config.PORT, '127.0.0.1') @@ -38,7 +40,7 @@ module.exports = { // the user running the test some directions. rp.once("exit", function (code) { if (code !== 0) spawnFailed = true; - }) + }); // wait for redis to become available, by // checking the port we bind on. @@ -66,26 +68,3 @@ module.exports = { }); } }; - -// wait for redis to be listening in -// all three modes (ipv4, ipv6, socket). -function waitForRedis (available, cb) { - if (process.platform === 'win32') return cb(); - - var ipV4 = false; - var id = setInterval(function () { - tcpPortUsed.check(config.PORT, '127.0.0.1') - .then(function (_ipV4) { - ipV4 = _ipV4; - return tcpPortUsed.check(config.PORT, '::1'); - }) - .then(function (ipV6) { - if (ipV6 === available && ipV4 === available && - fs.existsSync('/tmp/redis.sock') === available) { - clearInterval(id); - return cb(); - } - }); - }, 100); -} ->>>>>>> down to one failing test on Windows, time to rebase