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

25 lines
488 B
JavaScript
Raw Normal View History

2021-03-16 12:46:13 +01:00
const elastic = {}
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