import * as mongodb from "mongodb" ; import { BulkWriteResult } from "mongodb" ; export class MockBulk implements mongodb . UnorderedBulkOperation , mongodb . FindOperatorsUnordered { length : number ; findDocuments : any [ ] = [ ] ; replaceOneDocuments : any [ ] = [ ] ; removeOneCalled = 0 ; update ( updateDocument ) { return this ; } updateOne ( updateDocument ) { return this ; } replaceOne ( updateDocument ) { this . replaceOneDocuments . push ( updateDocument ) ; return this ; } upsert ( ) { return this ; } removeOne ( ) { this . removeOneCalled ++ ; return this ; } remove ( ) { return this ; } insert ( document ) { return this ; } find ( selector ? ) { this . findDocuments . push ( selector ) ; return this ; } execute ( optionsOrCallback , callback ? ) { return null ; } }