1
0
Fork 0
mirror of synced 2024-07-01 20:41:03 +12:00
budibase/packages/server/__mocks__/@elastic/elasticsearch.ts

25 lines
494 B
TypeScript

const elastic: any = {}
elastic.Client = function () {
this.index = jest.fn().mockResolvedValue({ body: [] })
this.search = jest.fn().mockResolvedValue({
body: {
hits: {
hits: [
{
_source: {
name: "test",
},
},
],
},
},
})
this.update = jest.fn().mockResolvedValue({ body: [] })
this.delete = jest.fn().mockResolvedValue({ body: [] })
this.close = jest.fn()
}
module.exports = elastic