File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,18 @@ describe("publish/subscribe", function () {
124
124
it ( 'receives messages if subscribe is called after unsubscribe' , function ( done ) {
125
125
helper . serverVersionAtLeast . bind ( this ) ( sub , [ 2 , 6 , 11 ] ) ;
126
126
127
+ var end = helper . callFuncAfter ( done , 2 ) ;
127
128
sub . once ( "subscribe" , function ( chnl , count ) {
128
- pub . publish ( channel , message , helper . isNumber ( 1 ) ) ;
129
+ pub . publish ( channel , message , function ( err , res ) {
130
+ helper . isNumber ( 1 ) ( err , res ) ;
131
+ end ( ) ;
132
+ } ) ;
129
133
} ) ;
130
134
131
135
sub . on ( "message" , function ( chnl , msg ) {
132
136
assert . equal ( chnl , channel ) ;
133
137
assert . equal ( msg , message ) ;
134
- return done ( ) ;
138
+ end ( ) ;
135
139
} ) ;
136
140
137
141
sub . subscribe ( channel ) ;
@@ -371,8 +375,9 @@ describe("publish/subscribe", function () {
371
375
} ) ;
372
376
373
377
afterEach ( function ( ) {
374
- sub . end ( true ) ;
375
- pub . end ( true ) ;
378
+ // Explicitly ignore still running commands
379
+ pub . end ( false ) ;
380
+ sub . end ( false ) ;
376
381
} ) ;
377
382
} ) ;
378
383
} ) ;
You can’t perform that action at this time.
0 commit comments