@@ -131,17 +131,22 @@ describe('utils.js', function () {
131
131
} ) ;
132
132
133
133
it ( 'elements in the offline queue. Reply after the offline queue is empty and respect the command_obj callback' , function ( done ) {
134
- clientMock . offline_queue . push ( create_command_obj ( ) , create_command_obj ( ) ) ;
134
+ clientMock . offline_queue . push ( create_command_obj ( ) ) ;
135
+ clientMock . offline_queue . push ( create_command_obj ( ) ) ;
135
136
utils . reply_in_order ( clientMock , function ( ) {
136
137
assert . strictEqual ( clientMock . offline_queue . length , 0 ) ;
137
138
assert . strictEqual ( res_count , 2 ) ;
138
139
done ( ) ;
139
140
} , null , null ) ;
140
- while ( clientMock . offline_queue . length ) clientMock . offline_queue . shift ( ) . callback ( null , 'foo' ) ;
141
+ while ( clientMock . offline_queue . length ) {
142
+ clientMock . offline_queue . shift ( ) . callback ( null , 'foo' ) ;
143
+ }
141
144
} ) ;
142
145
143
146
it ( 'elements in the offline queue. Reply after the offline queue is empty and respect the command_obj error emit' , function ( done ) {
144
- clientMock . command_queue . push ( { } , create_command_obj ( ) , { } ) ;
147
+ clientMock . command_queue . push ( { } ) ;
148
+ clientMock . command_queue . push ( create_command_obj ( ) ) ;
149
+ clientMock . command_queue . push ( { } ) ;
145
150
utils . reply_in_order ( clientMock , function ( ) {
146
151
assert . strictEqual ( clientMock . command_queue . length , 0 ) ;
147
152
assert ( emitted ) ;
@@ -158,8 +163,10 @@ describe('utils.js', function () {
158
163
} ) ;
159
164
160
165
it ( 'elements in the offline queue and the command_queue. Reply all other commands got handled respect the command_obj' , function ( done ) {
161
- clientMock . command_queue . push ( create_command_obj ( ) , create_command_obj ( ) ) ;
162
- clientMock . offline_queue . push ( create_command_obj ( ) , { } ) ;
166
+ clientMock . command_queue . push ( create_command_obj ( ) ) ;
167
+ clientMock . command_queue . push ( create_command_obj ( ) ) ;
168
+ clientMock . command_queue . push ( create_command_obj ( ) ) ;
169
+ clientMock . offline_queue . push ( { } ) ;
163
170
utils . reply_in_order ( clientMock , function ( err , res ) {
164
171
assert . strictEqual ( clientMock . command_queue . length , 0 ) ;
165
172
assert . strictEqual ( clientMock . offline_queue . length , 0 ) ;
0 commit comments