File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -211,12 +211,16 @@ describe('new Connection()', function () {
211
211
hostAddress : server . hostAddress ( )
212
212
} ;
213
213
214
+ const serverSpy = sinon . spy ( server , 'command' ) ;
214
215
const connectAsync = promisify ( connect ) ;
215
216
const connection : Connection = await connectAsync ( options ) ;
216
217
const commandSpy = sinon . spy ( connection , 'command' ) ;
217
218
218
- connection . commandAsync ( ns ( 'dummy' ) , { ping : 1 } , { } ) ;
219
- await expect ( commandSpy ) . to . have . been . calledOnce ;
219
+ await connection . commandAsync ( ns ( 'dummy' ) , { ping : 1 } , { } ) ;
220
+ expect ( commandSpy ) . to . have . been . calledOnce ;
221
+
222
+ await server . commandAsync ( ns ( 'dummy' ) , { ping : 1 } , { } ) ;
223
+ expect ( serverSpy ) . to . have . been . calledOnce ;
220
224
} ) ;
221
225
222
226
it ( 'throws a network error with kBeforeHandshake set to true on timeout before handshake' , function ( done ) {
You can’t perform that action at this time.
0 commit comments