Reorganized test and force 100% code coverage (#1226)
This commit is contained in:
committed by
delvedor
parent
c08a0fa6ce
commit
08898ac4d5
@ -275,7 +275,7 @@ test('Stop a msearch processor (callbacks)', t => {
|
||||
})
|
||||
|
||||
test('Bad header', t => {
|
||||
t.plan(1)
|
||||
t.plan(2)
|
||||
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
@ -294,11 +294,16 @@ test('Bad header', t => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
m.search(null, { query: { match: { foo: 'bar' } } })
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The header should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
})
|
||||
|
||||
test('Bad body', t => {
|
||||
t.plan(1)
|
||||
t.plan(2)
|
||||
|
||||
const MockConnection = connection.buildMockConnection({
|
||||
onRequest (params) {
|
||||
@ -317,6 +322,11 @@ test('Bad body', t => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
m.search({ index: 'test' }, null)
|
||||
.catch(err => {
|
||||
t.strictEqual(err.message, 'The body should be an object')
|
||||
})
|
||||
|
||||
t.teardown(() => m.stop())
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user