File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,20 @@ describe("publish/subscribe", function () {
208
208
} ) ;
209
209
} ) ;
210
210
211
+ describe ( 'psubscribe' , function ( ) {
212
+ // test motivated by issue #753
213
+ it ( 'allows all channels to be subscribed to using a * pattern' , function ( done ) {
214
+ sub . psubscribe ( '*' ) ;
215
+ sub . on ( "pmessage" , function ( pattern , channel , message ) {
216
+ assert . strictEqual ( pattern , '*' ) ;
217
+ assert . strictEqual ( channel , '/foo' ) ;
218
+ assert . strictEqual ( message , 'hello world' ) ;
219
+ return done ( ) ;
220
+ } )
221
+ pub . publish ( '/foo' , 'hello world' ) ;
222
+ } ) ;
223
+ } ) ;
224
+
211
225
describe ( 'punsubscribe' , function ( ) {
212
226
it ( 'does not complain when punsubscribe is called and there are no subscriptions' , function ( ) {
213
227
sub . punsubscribe ( )
You can’t perform that action at this time.
0 commit comments