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