1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Improve coverage; make tests ready for Redis 3.2

Add command sanity check
This commit is contained in:
Ruben Bridgewater
2016-04-21 02:56:06 +02:00
parent eae16938cd
commit ce1678c778
9 changed files with 79 additions and 24 deletions

View File

@@ -318,6 +318,24 @@ describe('connection tests', function () {
port: 9999
});
});
it('retry_strategy used to reconnect with defaults', function (done) {
client = redis.createClient({
retry_strategy: function (options) {
client.set('foo', 'bar');
return null;
}
});
setTimeout(function () {
client.stream.destroy();
}, 50);
client.on('error', function (err) {
assert.strictEqual(err.code, 'NR_OFFLINE');
assert.strictEqual(err.errors.length, 1);
assert.notStrictEqual(err.message, err.errors[0].message);
done();
});
});
});
describe('when not connected', function () {