Merge branch 'master' into 5.x

This commit is contained in:
delvedor
2019-03-26 12:12:01 +01:00
271 changed files with 17840 additions and 1383 deletions

View File

@ -19,7 +19,7 @@
'use strict'
const { Client } = require('../../index')
const { Client, errors } = require('../../index')
const { buildServer } = require('../utils')
function runAsyncTest (test) {
@ -76,6 +76,21 @@ function runAsyncTest (test) {
server.stop()
})
})
test('async await (ConfigurationError)', async t => {
t.plan(1)
const client = new Client({
node: 'http://localhost:9200'
})
try {
await client.index({ body: { foo: 'bar' } })
t.fail('Should throw')
} catch (err) {
t.ok(err instanceof errors.ConfigurationError)
}
})
}
module.exports = runAsyncTest