File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -128,18 +128,20 @@ describe('Subscribe to buffer', () => {
128
128
// when using messageBuffer, with redis instance the channel name is not a string but a buffer
129
129
const pubSub = new RedisPubSub ( { messageEventName : 'messageBuffer' } ) ;
130
130
const payload = 'This is amazing' ;
131
+ let subId ;
131
132
pubSub . subscribe ( 'Posts' , message => {
132
133
try {
133
134
expect ( message ) . to . be . instanceOf ( Buffer ) ;
134
135
expect ( message . toString ( 'utf-8' ) ) . to . be . equal ( payload ) ;
136
+ pubSub . unsubscribe ( subId ) ;
135
137
done ( ) ;
136
138
} catch ( e ) {
137
139
done ( e ) ;
138
140
}
139
141
} ) . then ( async subId => {
140
142
try {
141
143
await pubSub . publish ( 'Posts' , Buffer . from ( payload , 'utf-8' ) ) ;
142
- // pubSub.unsubscribe( subId) ;
144
+ subId = subId ;
143
145
} catch ( e ) {
144
146
done ( e ) ;
145
147
}
You can’t perform that action at this time.
0 commit comments