File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 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 () {
124124 it ( 'receives messages if subscribe is called after unsubscribe' , function ( done ) {
125125 helper . serverVersionAtLeast . bind ( this ) ( sub , [ 2 , 6 , 11 ] ) ;
126126
127+ var end = helper . callFuncAfter ( done , 2 ) ;
127128 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+ } ) ;
129133 } ) ;
130134
131135 sub . on ( "message" , function ( chnl , msg ) {
132136 assert . equal ( chnl , channel ) ;
133137 assert . equal ( msg , message ) ;
134- return done ( ) ;
138+ end ( ) ;
135139 } ) ;
136140
137141 sub . subscribe ( channel ) ;
@@ -371,8 +375,9 @@ describe("publish/subscribe", function () {
371375 } ) ;
372376
373377 afterEach ( function ( ) {
374- sub . end ( true ) ;
375- pub . end ( true ) ;
378+ // Explicitly ignore still running commands
379+ pub . end ( false ) ;
380+ sub . end ( false ) ;
376381 } ) ;
377382 } ) ;
378383 } ) ;
You can’t perform that action at this time.
0 commit comments