Improve code coverage (#1124)

* Helpers: Fixed stats counting

* Improve code coverage
This commit is contained in:
Tomas Della Vedova
2020-03-24 12:27:05 +01:00
committed by GitHub
parent f99fe71b67
commit 85616b07ef
5 changed files with 200 additions and 4 deletions

View File

@ -40,3 +40,22 @@ test('Search should have an additional documents property', async t => {
{ three: 'three' }
])
})
test('kGetHits fallback', async t => {
const MockConnection = connection.buildMockConnection({
onRequest (params) {
return { body: {} }
}
})
const client = new Client({
node: 'http://localhost:9200',
Connection: MockConnection
})
const result = await client.helpers.search({
index: 'test',
body: { foo: 'bar' }
})
t.deepEqual(result, [])
})