From f543d45d1f0da0c12bfebae56b8df4a2f605d06c Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 17 Sep 2015 05:16:36 +0200 Subject: [PATCH] Fix and add more tests --- test/commands/blpop.spec.js | 1 - test/commands/client.spec.js | 1 - test/commands/dbsize.spec.js | 2 -- test/commands/del.spec.js | 1 - test/commands/eval.spec.js | 1 - test/commands/exits.spec.js | 1 - test/commands/expire.spec.js | 1 - test/commands/flushdb.spec.js | 2 -- test/commands/get.spec.js | 2 -- test/commands/getset.spec.js | 2 -- test/commands/hgetall.spec.js | 2 -- test/commands/hincrby.spec.js | 1 - test/commands/hlen.spec.js | 1 - test/commands/hmset.spec.js | 1 - test/commands/hset.spec.js | 1 - test/commands/incr.spec.js | 1 - test/commands/keys.spec.js | 1 - test/commands/mset.spec.js | 2 -- test/commands/msetnx.spec.js | 1 - test/commands/multi.spec.js | 13 +++++++++++-- test/commands/randomkey.test.js | 1 - test/commands/rename.spec.js | 1 - test/commands/renamenx.spec.js | 1 - test/commands/rpush.spec.js | 1 - test/commands/sadd.spec.js | 1 - test/commands/scard.spec.js | 1 - test/commands/script.spec.js | 1 - test/commands/sdiff.spec.js | 1 - test/commands/sdiffstore.spec.js | 1 - test/commands/select.spec.js | 2 -- test/commands/set.spec.js | 2 -- test/commands/setex.spec.js | 1 - test/commands/setnx.spec.js | 1 - test/commands/sinter.spec.js | 1 - test/commands/sinterstore.spec.js | 1 - test/commands/sismember.spec.js | 1 - test/commands/slowlog.spec.js | 1 - test/commands/smembers.spec.js | 1 - test/commands/smove.spec.js | 1 - test/commands/spop.spec.js | 1 - test/commands/srem.spec.js | 1 - test/commands/sunion.spec.js | 1 - test/commands/sunionstore.spec.js | 1 - test/commands/ttl.spec.js | 1 - test/commands/type.spec.js | 1 - test/commands/watch.spec.js | 1 - test/node_redis.spec.js | 5 +++-- 47 files changed, 14 insertions(+), 57 deletions(-) diff --git a/test/commands/blpop.spec.js b/test/commands/blpop.spec.js index 7f1aeb1947..ea9dfdf21c 100644 --- a/test/commands/blpop.spec.js +++ b/test/commands/blpop.spec.js @@ -15,7 +15,6 @@ describe("The 'blpop' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/client.spec.js b/test/commands/client.spec.js index 5636df976c..5707d1ab89 100644 --- a/test/commands/client.spec.js +++ b/test/commands/client.spec.js @@ -15,7 +15,6 @@ describe("The 'client' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/dbsize.spec.js b/test/commands/dbsize.spec.js index a3f4872f14..7bc03219b9 100644 --- a/test/commands/dbsize.spec.js +++ b/test/commands/dbsize.spec.js @@ -23,7 +23,6 @@ describe("The 'dbsize' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -45,7 +44,6 @@ describe("The 'dbsize' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(function (err, res) { helper.isString("OK")(err, res); diff --git a/test/commands/del.spec.js b/test/commands/del.spec.js index 69f3930c29..0adb6327d8 100644 --- a/test/commands/del.spec.js +++ b/test/commands/del.spec.js @@ -13,7 +13,6 @@ describe("The 'del' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/eval.spec.js b/test/commands/eval.spec.js index d11fc50911..a22098e333 100644 --- a/test/commands/eval.spec.js +++ b/test/commands/eval.spec.js @@ -16,7 +16,6 @@ describe("The 'eval' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/exits.spec.js b/test/commands/exits.spec.js index 1d6d778b39..061e367133 100644 --- a/test/commands/exits.spec.js +++ b/test/commands/exits.spec.js @@ -13,7 +13,6 @@ describe("The 'exits' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/expire.spec.js b/test/commands/expire.spec.js index b0480b6c1d..1e3d9073e9 100644 --- a/test/commands/expire.spec.js +++ b/test/commands/expire.spec.js @@ -13,7 +13,6 @@ describe("The 'expire' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/flushdb.spec.js b/test/commands/flushdb.spec.js index aeee2638f3..12f10de8e8 100644 --- a/test/commands/flushdb.spec.js +++ b/test/commands/flushdb.spec.js @@ -23,7 +23,6 @@ describe("The 'flushdb' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -45,7 +44,6 @@ describe("The 'flushdb' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); diff --git a/test/commands/get.spec.js b/test/commands/get.spec.js index 780b224ff0..973629945d 100644 --- a/test/commands/get.spec.js +++ b/test/commands/get.spec.js @@ -23,7 +23,6 @@ describe("The 'get' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -45,7 +44,6 @@ describe("The 'get' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); diff --git a/test/commands/getset.spec.js b/test/commands/getset.spec.js index 2f4c391f49..e35ec7e616 100644 --- a/test/commands/getset.spec.js +++ b/test/commands/getset.spec.js @@ -24,7 +24,6 @@ describe("The 'getset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -47,7 +46,6 @@ describe("The 'getset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); diff --git a/test/commands/hgetall.spec.js b/test/commands/hgetall.spec.js index 958e717c8c..faac08d08e 100644 --- a/test/commands/hgetall.spec.js +++ b/test/commands/hgetall.spec.js @@ -16,7 +16,6 @@ describe("The 'hgetall' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); @@ -58,7 +57,6 @@ describe("The 'hgetall' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/hincrby.spec.js b/test/commands/hincrby.spec.js index 7d55f11c06..43a73826e3 100644 --- a/test/commands/hincrby.spec.js +++ b/test/commands/hincrby.spec.js @@ -14,7 +14,6 @@ describe("The 'hincrby' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/hlen.spec.js b/test/commands/hlen.spec.js index 564f248ed5..3d6d675b96 100644 --- a/test/commands/hlen.spec.js +++ b/test/commands/hlen.spec.js @@ -13,7 +13,6 @@ describe("The 'hlen' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/hmset.spec.js b/test/commands/hmset.spec.js index 8846b9e9d7..6060677e0f 100644 --- a/test/commands/hmset.spec.js +++ b/test/commands/hmset.spec.js @@ -15,7 +15,6 @@ describe("The 'hmset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/hset.spec.js b/test/commands/hset.spec.js index 0424a97fd5..66ff79086c 100644 --- a/test/commands/hset.spec.js +++ b/test/commands/hset.spec.js @@ -15,7 +15,6 @@ describe("The 'hset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/incr.spec.js b/test/commands/incr.spec.js index eca68ced15..cdf5fecac3 100644 --- a/test/commands/incr.spec.js +++ b/test/commands/incr.spec.js @@ -17,7 +17,6 @@ describe("The 'incr' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.set(key, "9007199254740992", function (err, res) { helper.isNotError()(err, res); diff --git a/test/commands/keys.spec.js b/test/commands/keys.spec.js index b7a3660f47..60c1e84404 100644 --- a/test/commands/keys.spec.js +++ b/test/commands/keys.spec.js @@ -15,7 +15,6 @@ describe("The 'keys' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/mset.spec.js b/test/commands/mset.spec.js index 27070dc803..be2e3a4baf 100644 --- a/test/commands/mset.spec.js +++ b/test/commands/mset.spec.js @@ -25,7 +25,6 @@ describe("The 'mset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -47,7 +46,6 @@ describe("The 'mset' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); diff --git a/test/commands/msetnx.spec.js b/test/commands/msetnx.spec.js index 1ac77e1894..7af7fbc27a 100644 --- a/test/commands/msetnx.spec.js +++ b/test/commands/msetnx.spec.js @@ -13,7 +13,6 @@ describe("The 'msetnx' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/multi.spec.js b/test/commands/multi.spec.js index a18478b3de..60ac2e07fa 100644 --- a/test/commands/multi.spec.js +++ b/test/commands/multi.spec.js @@ -23,7 +23,6 @@ describe("The 'multi' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -46,7 +45,6 @@ describe("The 'multi' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(function (err) { return done(err); @@ -298,6 +296,17 @@ describe("The 'multi' method", function () { }); }); + it("should work without any callback", function (done) { + helper.serverVersionAtLeast.call(this, client, [2, 6, 5]); + + var multi = client.multi(); + multi.set("baz", "binary"); + multi.set("foo", "bar"); + multi.exec(); + + client.get('foo', helper.isString('bar', done)); + }); + }); }); }); diff --git a/test/commands/randomkey.test.js b/test/commands/randomkey.test.js index 4c81ed2edb..85e61ef597 100644 --- a/test/commands/randomkey.test.js +++ b/test/commands/randomkey.test.js @@ -14,7 +14,6 @@ describe("The 'randomkey' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/rename.spec.js b/test/commands/rename.spec.js index d506bec46c..02434cc923 100644 --- a/test/commands/rename.spec.js +++ b/test/commands/rename.spec.js @@ -13,7 +13,6 @@ describe("The 'rename' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/renamenx.spec.js b/test/commands/renamenx.spec.js index dc2224ee58..e2fbdcfd03 100644 --- a/test/commands/renamenx.spec.js +++ b/test/commands/renamenx.spec.js @@ -13,7 +13,6 @@ describe("The 'renamenx' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/rpush.spec.js b/test/commands/rpush.spec.js index 5c46c7dc79..ba3cb56415 100644 --- a/test/commands/rpush.spec.js +++ b/test/commands/rpush.spec.js @@ -14,7 +14,6 @@ describe("The 'rpush' command", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sadd.spec.js b/test/commands/sadd.spec.js index 6c92dfe201..dcc5e1cd42 100644 --- a/test/commands/sadd.spec.js +++ b/test/commands/sadd.spec.js @@ -14,7 +14,6 @@ describe("The 'sadd' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/scard.spec.js b/test/commands/scard.spec.js index 423cba9805..8c366e7383 100644 --- a/test/commands/scard.spec.js +++ b/test/commands/scard.spec.js @@ -13,7 +13,6 @@ describe("The 'scard' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/script.spec.js b/test/commands/script.spec.js index 29dfaa63dd..19d77084b8 100644 --- a/test/commands/script.spec.js +++ b/test/commands/script.spec.js @@ -17,7 +17,6 @@ describe("The 'script' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sdiff.spec.js b/test/commands/sdiff.spec.js index cb2a97f14b..43c6d1434e 100644 --- a/test/commands/sdiff.spec.js +++ b/test/commands/sdiff.spec.js @@ -14,7 +14,6 @@ describe("The 'sdiff' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sdiffstore.spec.js b/test/commands/sdiffstore.spec.js index 7546c446ce..52abb487e4 100644 --- a/test/commands/sdiffstore.spec.js +++ b/test/commands/sdiffstore.spec.js @@ -14,7 +14,6 @@ describe("The 'sdiffstore' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/select.spec.js b/test/commands/select.spec.js index 4df653f26c..1ad7de94c1 100644 --- a/test/commands/select.spec.js +++ b/test/commands/select.spec.js @@ -15,7 +15,6 @@ describe("The 'select' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -37,7 +36,6 @@ describe("The 'select' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); }); diff --git a/test/commands/set.spec.js b/test/commands/set.spec.js index ed0f6307a5..048450d5b4 100644 --- a/test/commands/set.spec.js +++ b/test/commands/set.spec.js @@ -23,7 +23,6 @@ describe("The 'set' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.quit(); }); @@ -45,7 +44,6 @@ describe("The 'set' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { done(); }); diff --git a/test/commands/setex.spec.js b/test/commands/setex.spec.js index 334f92cdbf..5ad1fd1b41 100644 --- a/test/commands/setex.spec.js +++ b/test/commands/setex.spec.js @@ -14,7 +14,6 @@ describe("The 'setex' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/setnx.spec.js b/test/commands/setnx.spec.js index 0092a33fac..5d9f358dc7 100644 --- a/test/commands/setnx.spec.js +++ b/test/commands/setnx.spec.js @@ -13,7 +13,6 @@ describe("The 'setnx' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sinter.spec.js b/test/commands/sinter.spec.js index e03973755c..b7df78c995 100644 --- a/test/commands/sinter.spec.js +++ b/test/commands/sinter.spec.js @@ -14,7 +14,6 @@ describe("The 'sinter' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sinterstore.spec.js b/test/commands/sinterstore.spec.js index 38a9ffc39b..f789c42dfb 100644 --- a/test/commands/sinterstore.spec.js +++ b/test/commands/sinterstore.spec.js @@ -14,7 +14,6 @@ describe("The 'sinterstore' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sismember.spec.js b/test/commands/sismember.spec.js index d5e4a554f8..a7ee9ad0e0 100644 --- a/test/commands/sismember.spec.js +++ b/test/commands/sismember.spec.js @@ -13,7 +13,6 @@ describe("The 'sismember' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/slowlog.spec.js b/test/commands/slowlog.spec.js index 846694d54d..eee3fa1d87 100644 --- a/test/commands/slowlog.spec.js +++ b/test/commands/slowlog.spec.js @@ -14,7 +14,6 @@ describe("The 'slowlog' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/smembers.spec.js b/test/commands/smembers.spec.js index acca8f899d..32078ef7bd 100644 --- a/test/commands/smembers.spec.js +++ b/test/commands/smembers.spec.js @@ -14,7 +14,6 @@ describe("The 'smembers' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/smove.spec.js b/test/commands/smove.spec.js index 4b65b150cd..e16e619119 100644 --- a/test/commands/smove.spec.js +++ b/test/commands/smove.spec.js @@ -13,7 +13,6 @@ describe("The 'smove' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/spop.spec.js b/test/commands/spop.spec.js index 0beb4869a1..2df75dd653 100644 --- a/test/commands/spop.spec.js +++ b/test/commands/spop.spec.js @@ -14,7 +14,6 @@ describe("The 'spop' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/srem.spec.js b/test/commands/srem.spec.js index d6a64a006e..c075a987aa 100644 --- a/test/commands/srem.spec.js +++ b/test/commands/srem.spec.js @@ -14,7 +14,6 @@ describe("The 'srem' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sunion.spec.js b/test/commands/sunion.spec.js index 2477526d0b..6fb1bb0332 100644 --- a/test/commands/sunion.spec.js +++ b/test/commands/sunion.spec.js @@ -14,7 +14,6 @@ describe("The 'sunion' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/sunionstore.spec.js b/test/commands/sunionstore.spec.js index a4086de6a3..c6e9cdeb60 100644 --- a/test/commands/sunionstore.spec.js +++ b/test/commands/sunionstore.spec.js @@ -14,7 +14,6 @@ describe("The 'sunionstore' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/ttl.spec.js b/test/commands/ttl.spec.js index 5e1f56150f..edc2db5c10 100644 --- a/test/commands/ttl.spec.js +++ b/test/commands/ttl.spec.js @@ -14,7 +14,6 @@ describe("The 'ttl' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/type.spec.js b/test/commands/type.spec.js index e9ec7b95f3..9c99da0fbd 100644 --- a/test/commands/type.spec.js +++ b/test/commands/type.spec.js @@ -13,7 +13,6 @@ describe("The 'type' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/commands/watch.spec.js b/test/commands/watch.spec.js index 5354525c30..133fc770ca 100644 --- a/test/commands/watch.spec.js +++ b/test/commands/watch.spec.js @@ -16,7 +16,6 @@ describe("The 'watch' method", function () { beforeEach(function (done) { client = redis.createClient.apply(redis.createClient, args); - client.once("error", done); client.once("connect", function () { client.flushdb(done); }); diff --git a/test/node_redis.spec.js b/test/node_redis.spec.js index 35e8ed5292..1883837a72 100644 --- a/test/node_redis.spec.js +++ b/test/node_redis.spec.js @@ -156,7 +156,7 @@ describe("The node_redis client", function () { process.once('uncaughtException', function (err) { process.on('uncaughtException', mochaListener); - assert(/is not a function|toUpperCase/.test(err)); + assert(/ERR Protocol error/.test(err)); done(); }); @@ -359,7 +359,8 @@ describe("The node_redis client", function () { }); - it('emits errors thrown from within an on("message") handler', function (done) { + // This seems to be a broken test. The exception should be handled by the user, not by node_redis + it.skip('emits errors thrown from within an on("message") handler', function (done) { var client2 = redis.createClient.apply(redis.createClient, args); var name = 'channel';