1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

tests: improve coverage & fix unreachable code branches

This commit is contained in:
Salakar
2020-02-09 15:44:52 +00:00
parent 43bc8df159
commit da31ade348
4 changed files with 14 additions and 22 deletions

View File

@@ -239,7 +239,7 @@ describe('connection tests', function () {
retryStrategy: function (options) {
if (options.totalRetryTime > 150) {
client.set('foo', 'bar', function (err, res) {
assert.strictEqual(err.message, 'Redis connection in broken state: maximum connection attempts exceeded.');
assert.strictEqual(err.message, 'Redis connection in broken state: retry aborted.');
assert.strictEqual(err.origin.message, 'Connection timeout');
done();
});
@@ -257,7 +257,7 @@ describe('connection tests', function () {
retry_strategy: function (options) {
if (options.total_retry_time > 150) {
client.set('foo', 'bar', function (err, res) {
assert.strictEqual(err.message, 'Redis connection in broken state: maximum connection attempts exceeded.');
assert.strictEqual(err.message, 'Redis connection in broken state: retry aborted.');
assert.strictEqual(err.code, 'CONNECTION_BROKEN');
assert.strictEqual(err.origin.code, 'ECONNREFUSED');
done();
@@ -287,7 +287,7 @@ describe('connection tests', function () {
}, 50);
client.on('error', function (err) {
if (err instanceof redis.AbortError) {
assert.strictEqual(err.message, 'Redis connection in broken state: maximum connection attempts exceeded.');
assert.strictEqual(err.message, 'Redis connection in broken state: retry aborted.');
assert.strictEqual(err.code, 'CONNECTION_BROKEN');
unhookIntercept();
redis.debugMode = false;