budibase/packages/server/__mocks__/@elastic/elasticsearch.ts

25 lines
494 B
TypeScript
Raw Normal View History

const elastic: any = {}
2021-03-16 12:46:13 +01:00
2021-05-03 09:31:09 +02:00
elastic.Client = function () {
2021-03-16 12:46:13 +01:00
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