Skip to content

Commit 931677e

Browse files
committed
Reformat test that fails on some OSes
1 parent 3779d96 commit 931677e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/unit/client.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,12 @@ test('Elastic Cloud config', t => {
293293
})
294294

295295
t.ok(client.connectionPool instanceof CloudConnectionPool)
296-
t.match(client.connectionPool.connections.find(c => c.id === 'https://abcd.localhost/'), {
297-
url: new URL('https://elastic:[email protected]'),
298-
id: 'https://abcd.localhost/',
299-
headers: {
300-
authorization: 'Basic ' + Buffer.from('elastic:changeme').toString('base64')
301-
},
302-
tls: { secureProtocol: 'TLSv1_2_method' }
303-
})
296+
const connection = client.connectionPool.connections.find(c => c.id === 'https://abcd.localhost/')
297+
298+
t.equal(connection?.headers?.authorization, `Basic ${Buffer.from('elastic:changeme').toString('base64')}`)
299+
t.same(connection?.tls, { secureProtocol: 'TLSv1_2_method' })
300+
t.equal(connection?.url.hostname, 'abcd.localhost')
301+
t.equal(connection?.url.protocol, 'https:')
304302

305303
t.end()
306304
})

0 commit comments

Comments
 (0)