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

chore: improve coverage

This commit is contained in:
Ruben Bridgewater
2017-05-30 06:45:28 +02:00
parent 31fafd8b7c
commit b6c317dbb0
8 changed files with 82 additions and 12 deletions

View File

@@ -413,6 +413,20 @@ describe('connection tests', () => {
})
})
it('connects correctly even if the info command returns a empty string', (done) => {
client = Redis.createClient.apply(null, args)
const end = helper.callFuncAfter(done, 2)
client.info = function () {
// Mock the result
end()
return Promise.resolve('')
}
client.once('ready', () => {
assert.strictEqual(Object.keys(client.serverInfo).length, 0)
end()
})
})
if (ip === 'IPv4') {
it('allows connecting with the redis url to the default host and port, select db 3 and warn about duplicate db option', (done) => {
client = Redis.createClient('redis:///3?db=3')