1
0
Fork 0
mirror of synced 2024-07-07 07:15:43 +12:00
budibase/packages/server/__mocks__/mongodb.js

20 lines
373 B
JavaScript
Raw Normal View History

2021-03-17 02:54:39 +13:00
const mongodb = {}
mongodb.MongoClient = function() {
this.connect = jest.fn()
this.close = jest.fn()
this.insertOne = jest.fn()
this.find = jest.fn(() => ({ toArray: () => [] }))
this.collection = jest.fn(() => ({
insertOne: this.insertOne,
find: this.find,
}))
this.db = () => ({
collection: this.collection,
})
}
module.exports = mongodb