diff --git a/test/unit/operations/find.test.ts b/test/unit/operations/find.test.ts index 73b1b9ff722..657013de1c1 100644 --- a/test/unit/operations/find.test.ts +++ b/test/unit/operations/find.test.ts @@ -42,7 +42,7 @@ describe('FindOperation', function () { it('should build basic find command with filter', async () => { const findOperation = new FindOperation(undefined, namespace, filter); const stub = sinon.stub(server, 'command').yieldsRight(); - await findOperation.execute.bind(findOperation)(server, undefined); + await findOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith(namespace, { find: namespace.collection, filter @@ -55,7 +55,7 @@ describe('FindOperation', function () { }; const findOperation = new FindOperation(undefined, namespace, {}, options); const stub = sinon.stub(server, 'command').yieldsRight(); - await findOperation.execute.bind(findOperation)(server, undefined); + await findOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith( namespace, sinon.match.has('oplogReplay', options.oplogReplay) diff --git a/test/unit/operations/get_more.test.ts b/test/unit/operations/get_more.test.ts index 4ee81c7bd89..3abb798bc06 100644 --- a/test/unit/operations/get_more.test.ts +++ b/test/unit/operations/get_more.test.ts @@ -63,7 +63,7 @@ describe('GetMoreOperation', function () { maxTimeMS: 500 }; - await operation.execute.bind(operation)(server, undefined); + await operation.execute(server, undefined); expect(stub.calledOnce).to.be.true; const call = stub.getCall(0); expect(call.args[0]).to.equal(namespace); @@ -108,7 +108,7 @@ describe('GetMoreOperation', function () { it('should build basic getMore command with cursorId and collection', async () => { const getMoreOperation = new GetMoreOperation(namespace, cursorId, server, {}); const stub = sinon.stub(server, 'command').yieldsRight(); - await getMoreOperation.execute.bind(getMoreOperation)(server, undefined); + await getMoreOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith(namespace, { getMore: cursorId, collection: namespace.collection @@ -121,7 +121,7 @@ describe('GetMoreOperation', function () { }; const getMoreOperation = new GetMoreOperation(namespace, cursorId, server, options); const stub = sinon.stub(server, 'command').yieldsRight(); - await getMoreOperation.execute.bind(getMoreOperation)(server, undefined); + await getMoreOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith( namespace, sinon.match.has('batchSize', options.batchSize) @@ -134,7 +134,7 @@ describe('GetMoreOperation', function () { }; const getMoreOperation = new GetMoreOperation(namespace, cursorId, server, options); const stub = sinon.stub(server, 'command').yieldsRight(); - await getMoreOperation.execute.bind(getMoreOperation)(server, undefined); + await getMoreOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith( namespace, sinon.match.has('maxTimeMS', options.maxAwaitTimeMS) @@ -192,7 +192,7 @@ describe('GetMoreOperation', function () { }; const operation = new GetMoreOperation(namespace, cursorId, server, optionsWithComment); const stub = sinon.stub(server, 'command').yieldsRight(); - await operation.execute.bind(operation)(server, undefined); + await operation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith(namespace, getMore); }); } @@ -215,9 +215,7 @@ describe('GetMoreOperation', function () { server, options ); - const error = await getMoreOperation.execute - .bind(getMoreOperation)(server, undefined) - .catch(error => error); + const error = await getMoreOperation.execute(server, undefined).catch(error => error); expect(error).to.be.instanceOf(MongoRuntimeError); }); @@ -228,9 +226,7 @@ describe('GetMoreOperation', function () { server, options ); - const error = await getMoreOperation.execute - .bind(getMoreOperation)(server, undefined) - .catch(error => error); + const error = await getMoreOperation.execute(server, undefined).catch(error => error); expect(error).to.be.instanceOf(MongoRuntimeError); }); @@ -241,9 +237,7 @@ describe('GetMoreOperation', function () { server, options ); - const error = await getMoreOperation.execute - .bind(getMoreOperation)(server, undefined) - .catch(error => error); + const error = await getMoreOperation.execute(server, undefined).catch(error => error); expect(error).to.be.instanceOf(MongoRuntimeError); }); }); diff --git a/test/unit/operations/kill_cursors.test.ts b/test/unit/operations/kill_cursors.test.ts index 445f7207e78..4468cd33c65 100644 --- a/test/unit/operations/kill_cursors.test.ts +++ b/test/unit/operations/kill_cursors.test.ts @@ -64,8 +64,8 @@ describe('class KillCursorsOperation', () => { options ) as any; - const error = await killCursorsOperation.execute - .bind(killCursorsOperation)(differentServer, undefined) + const error = await killCursorsOperation + .execute(differentServer, undefined) .catch(error => error); expect(error).to.be.instanceOf(MongoRuntimeError); @@ -79,9 +79,7 @@ describe('class KillCursorsOperation', () => { options ) as any; - const error = await killCursorsOperation.execute - .bind(killCursorsOperation)(server, undefined) - .catch(error => error); + const error = await killCursorsOperation.execute(server, undefined).catch(error => error); expect(error).to.be.instanceOf(MongoRuntimeError); }); @@ -94,7 +92,7 @@ describe('class KillCursorsOperation', () => { options ) as any; const stub = sinon.stub(server, 'command').yieldsRight(); - await killCursorsOperation.execute.bind(killCursorsOperation)(server, undefined); + await killCursorsOperation.execute(server, undefined); expect(stub).to.have.been.calledOnceWith(namespace, { killCursors: namespace.collection, cursors: [cursorId]