Skip to content

Commit f5ea8ff

Browse files
committed
2 parents 37983cb + 4792203 commit f5ea8ff

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/unit/client.test.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,41 @@ test('Elastic cloud config', t => {
861861
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
862862
})
863863

864+
t.test('Without kibana component', t => {
865+
t.plan(5)
866+
const client = new Client({
867+
cloud: {
868+
// 'localhost$abcd$'
869+
id: 'name:bG9jYWxob3N0JGFiY2Qk',
870+
username: 'elastic',
871+
password: 'changeme'
872+
}
873+
})
874+
875+
const pool = client.connectionPool
876+
t.ok(pool instanceof CloudConnectionPool)
877+
t.match(pool.connections.find(c => c.id === 'https://abcd.localhost/'), {
878+
url: new URL('https://elastic:[email protected]'),
879+
id: 'https://abcd.localhost/',
880+
headers: {
881+
authorization: 'Basic ' + Buffer.from('elastic:changeme').toString('base64')
882+
},
883+
ssl: { secureProtocol: 'TLSv1_2_method' },
884+
deadCount: 0,
885+
resurrectTimeout: 0,
886+
roles: {
887+
master: true,
888+
data: true,
889+
ingest: true,
890+
ml: false
891+
}
892+
})
893+
894+
t.strictEqual(client.transport.compression, 'gzip')
895+
t.strictEqual(client.transport.suggestCompression, true)
896+
t.deepEqual(pool._ssl, { secureProtocol: 'TLSv1_2_method' })
897+
})
898+
864899
t.test('Auth as separate option', t => {
865900
t.plan(5)
866901
const client = new Client({

0 commit comments

Comments
 (0)