elastic / elastic-transport-js

Transport classes and utilities shared among Node.js Elastic client libraries
Apache License 2.0
4 stars 24 forks source link

Test with node v19; fix test with new keep-alive default in node v19 #61

Closed trentm closed 1 year ago

trentm commented 1 year ago

Node v19 has made keep-alive on by default, so using agent: false no longer disables keep-alive. I've fixed the test to handle that, so tests pass with node >= v19.


This also works around the following lint error:

src/connection/UndiciConnection.ts:184:74 - error TS2339: Property 'toLowerCase' does not exist on type 'string | string[]'.
  Property 'toLowerCase' does not exist on type 'string[]'.

184     const contentEncoding = (response.headers['content-encoding'] ?? '').toLowerCase()

I'm happy to drop that @ts-expect-error in favour of a more reliable fix there.

trentm commented 1 year ago

Nice. Thanks.