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

fix: always emit an error when the connection drops

This commit is contained in:
Ruben Bridgewater
2017-05-30 04:38:02 +02:00
parent 265ce48af4
commit ac26d0524d
8 changed files with 42 additions and 36 deletions

View File

@@ -194,7 +194,7 @@ describe('The \'multi\' method', () => {
})
describe('when connection is broken', () => {
it.skip('return an error even if connection is in broken mode', (done) => {
it('return an error even if connection is in broken mode', (done) => {
client = redis.createClient({
host: 'somewhere',
port: 6379,
@@ -202,13 +202,12 @@ describe('The \'multi\' method', () => {
})
client.on('error', (err) => {
if (/Redis connection in broken state/.test(err.message)) {
done()
}
assert.strictEqual(err.code, 'NR_CLOSED')
done()
})
client.multi([['set', 'foo', 'bar'], ['get', 'foo']]).exec().catch((err) => {
// assert(/Redis connection in broken state/.test(err.message));
assert(/Stream connection ended and command aborted/.test(err.message))
assert.strictEqual(err.errors.length, 2)
assert.strictEqual(err.errors[0].args.length, 2)
})