Reorganized test and force 100% code coverage (#1226)

This commit is contained in:
Tomas Della Vedova
2020-06-15 08:37:04 +02:00
committed by delvedor
parent acce06c2af
commit 24961869cc
16 changed files with 183 additions and 30 deletions

View File

@ -617,6 +617,14 @@ test('Connection id should not contain credentials', t => {
t.end()
})
test('Ipv6 support', t => {
const connection = new Connection({
url: new URL('http://[::1]:9200')
})
t.strictEqual(connection.buildRequestObject({}).hostname, '::1')
t.end()
})
test('Should throw if the protocol is not http or https', t => {
try {
new Connection({ // eslint-disable-line