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

feat: always return strings from "message" listener

Listening to "messageBuffer" returns Buffers
This commit is contained in:
Ruben Bridgewater
2017-05-28 08:41:01 +02:00
parent 6796f8806a
commit 5d6f072e56
3 changed files with 5 additions and 3 deletions

View File

@@ -444,7 +444,7 @@ describe('publish/subscribe', () => {
// sub2 is counted twice as it subscribed with psubscribe and subscribe
pub.publish('/foo', 'hello world').then(helper.isNumber(3))
})
sub2.on('pmessage', (pattern, channel, message) => {
sub2.on('pmessageBuffer', (pattern, channel, message) => {
assert.strictEqual(pattern.inspect(), Buffer.from('*').inspect())
assert.strictEqual(channel.inspect(), Buffer.from('/foo').inspect())
assert.strictEqual(message.inspect(), Buffer.from('hello world').inspect())