@@ -54,7 +54,7 @@ describe('GetMoreOperation', function () {
54
54
) ;
55
55
const opts = { ...options , documentsReturnedIn : 'nextBatch' , returnFieldSelector : null } ;
56
56
const operation = new GetMoreOperation ( namespace , cursorId , server , opts ) ;
57
- const stub = sinon . stub ( server , 'command' ) . returns ( Promise . resolve ( { } ) ) ;
57
+ const stub = sinon . stub ( server , 'command' ) . resolves ( { } ) ;
58
58
59
59
const expectedGetMoreCommand = {
60
60
getMore : cursorId ,
@@ -104,7 +104,7 @@ describe('GetMoreOperation', function () {
104
104
105
105
it ( 'should build basic getMore command with cursorId and collection' , async ( ) => {
106
106
const getMoreOperation = new GetMoreOperation ( namespace , cursorId , server , { } ) ;
107
- const stub = sinon . stub ( server , 'command' ) ;
107
+ const stub = sinon . stub ( server , 'command' ) . resolves ( { } ) ;
108
108
await getMoreOperation . execute ( server , undefined ) ;
109
109
expect ( stub ) . to . have . been . calledOnceWith ( namespace , {
110
110
getMore : cursorId ,
@@ -117,7 +117,7 @@ describe('GetMoreOperation', function () {
117
117
batchSize : 234
118
118
} ;
119
119
const getMoreOperation = new GetMoreOperation ( namespace , cursorId , server , options ) ;
120
- const stub = sinon . stub ( server , 'command' ) ;
120
+ const stub = sinon . stub ( server , 'command' ) . resolves ( { } ) ;
121
121
await getMoreOperation . execute ( server , undefined ) ;
122
122
expect ( stub ) . to . have . been . calledOnceWith (
123
123
namespace ,
@@ -130,7 +130,7 @@ describe('GetMoreOperation', function () {
130
130
maxAwaitTimeMS : 234
131
131
} ;
132
132
const getMoreOperation = new GetMoreOperation ( namespace , cursorId , server , options ) ;
133
- const stub = sinon . stub ( server , 'command' ) ;
133
+ const stub = sinon . stub ( server , 'command' ) . resolves ( { } ) ;
134
134
await getMoreOperation . execute ( server , undefined ) ;
135
135
expect ( stub ) . to . have . been . calledOnceWith (
136
136
namespace ,
@@ -188,7 +188,7 @@ describe('GetMoreOperation', function () {
188
188
maxWireVersion : serverVersion
189
189
} ;
190
190
const operation = new GetMoreOperation ( namespace , cursorId , server , optionsWithComment ) ;
191
- const stub = sinon . stub ( server , 'command' ) ;
191
+ const stub = sinon . stub ( server , 'command' ) . resolves ( { } ) ;
192
192
await operation . execute ( server , undefined ) ;
193
193
expect ( stub ) . to . have . been . calledOnceWith ( namespace , getMore ) ;
194
194
} ) ;
@@ -202,7 +202,7 @@ describe('GetMoreOperation', function () {
202
202
new ServerDescription ( 'a:1' ) ,
203
203
{ } as any
204
204
) ;
205
- sinon . stub ( server , 'command' ) ;
205
+ sinon . stub ( server , 'command' ) . resolves ( { } ) ;
206
206
207
207
it ( 'should throw if the cursorId is undefined' , async ( ) => {
208
208
const getMoreOperation = new GetMoreOperation (
0 commit comments