Browse Source

Merge pull request #876 from NodeRedis/test-tweak

a couple tweaks to get the test suite running on my old MacBook
greenkeeper-update-all
Benjamin E. Coe 9 years ago
parent
commit
2fc54ece57
  1. 6
      test/helper.js
  2. 7
      test/node_redis.spec.js

6
test/helper.js

@ -159,11 +159,11 @@ module.exports = {
killConnection: function (client) {
// Change the connection option to a non existing one and destroy the stream
client.connectionOption = {
port: 6370,
host: '127.0.0.2',
port: 65535,
host: '127.0.0.1',
family: 4
};
client.address = '127.0.0.2:6370';
client.address = '127.0.0.1:65535';
client.stream.destroy();
}
};

7
test/node_redis.spec.js

@ -214,7 +214,7 @@ describe("The node_redis client", function () {
var client = redis.createClient();
client.quit(function() {
client.get("foo", function(err, res) {
assert.strictEqual(err.message, 'Redis connection gone from end event.');
assert(err.message.indexOf('Redis connection gone') !== -1);
assert.strictEqual(client.offline_queue.length, 0);
done();
});
@ -355,6 +355,7 @@ describe("The node_redis client", function () {
}
});
});
});
describe('monitor', function () {
it('monitors commands on all other redis clients', function (done) {
@ -391,8 +392,6 @@ describe("The node_redis client", function () {
});
});
});
describe('idle', function () {
it('emits idle as soon as there are no outstanding commands', function (done) {
client.on('idle', function onIdle () {
@ -619,7 +618,7 @@ describe("The node_redis client", function () {
client.set('baz', 13);
client.set('foo', 'bar', function(err, result) {
assert(i, 3);
assert('Redis connection gone from error event', err.message);
assert(err);
assert.strictEqual(client.offline_queue.length, 0);
});
});

Loading…
Cancel
Save