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

feat: return channel number and channels from subscribe / unsubscribe calls

This commit is contained in:
Ruben Bridgewater
2017-05-06 00:27:44 +02:00
parent a6053c510a
commit 27ed4db537
5 changed files with 51 additions and 27 deletions

View File

@@ -321,14 +321,17 @@ describe('client authentication', function () {
assert.strictEqual(client.serverInfo.sync_full, '0');
})
.get('foo', helper.isString('bar'))
.subscribe(['foo', 'bar'])
.subscribe(['foo', 'bar', 'foo'], helper.isUnSubscribe(2, ['foo', 'bar', 'foo']))
.unsubscribe('foo')
.SUBSCRIBE('/foo', helper.isString('/foo'))
.SUBSCRIBE('/foo', helper.isUnSubscribe(2, '/foo'))
.psubscribe('*')
.quit(helper.isString('OK')) // this might be interesting
.quit(helper.isString('OK'))
.exec(function (err, res) {
res[4] = res[4].substr(0, 9);
assert.deepEqual(res, ['OK', 'OK', 'OK', 'OK', '# Stats\r\n', 'bar', 'bar', 'foo', '/foo', '*', 'OK']);
assert.deepStrictEqual(
res,
['OK', 'OK', 'OK', 'OK', '# Stats\r\n', 'bar', [2, ['foo', 'bar', 'foo']], [1, ['foo']], [2, ['/foo']], [3, ['*']], 'OK']
);
end();
});
});