[Backport 7.x] Allow the client name to be a symbol (#1257)

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2020-07-13 12:38:59 +02:00
committed by GitHub
parent 0dd5c3c186
commit 28f2be397c
6 changed files with 59 additions and 4 deletions

View File

@ -1092,3 +1092,26 @@ test('Random selector', t => {
})
})
})
test('name property as string', t => {
t.plan(1)
const client = new Client({
node: 'http://localhost:9200',
name: 'client-name'
})
t.strictEqual(client.name, 'client-name')
})
test('name property as symbol', t => {
t.plan(1)
const symbol = Symbol('client-name')
const client = new Client({
node: 'http://localhost:9200',
name: symbol
})
t.strictEqual(client.name, symbol)
})