diff --git a/.gitignore b/.gitignore index c38ae71df..99b15ab2f 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,6 @@ test/bundlers/parcel-test/.parcel-cache lib junit-output +bun.lockb +test-results +processinfo diff --git a/package.json b/package.json index 0339df281..7f515f586 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "semver": "^7.3.7", "split2": "^4.1.0", "stoppable": "^1.1.0", - "tap": "^16.1.0", + "tap": "^21.0.1", "ts-node": "^10.7.0", "ts-standard": "^11.0.0", "typescript": "^4.6.4", @@ -88,10 +88,9 @@ "tslib": "^2.4.0" }, "tap": { - "ts": true, - "jsx": false, - "flow": false, - "coverage": false, - "check-coverage": false + "disable-coverage": true, + "files": [ + "test/unit/{*,**/*}.test.ts" + ] } } diff --git a/test/unit/client.test.ts b/test/unit/client.test.ts index b896946ad..1afc2a709 100644 --- a/test/unit/client.test.ts +++ b/test/unit/client.test.ts @@ -293,14 +293,12 @@ test('Elastic Cloud config', t => { }) t.ok(client.connectionPool instanceof CloudConnectionPool) - t.match(client.connectionPool.connections.find(c => c.id === 'https://abcd.localhost/'), { - url: new URL('https://elastic:changeme@abcd.localhost'), - id: 'https://abcd.localhost/', - headers: { - authorization: 'Basic ' + Buffer.from('elastic:changeme').toString('base64') - }, - tls: { secureProtocol: 'TLSv1_2_method' } - }) + const connection = client.connectionPool.connections.find(c => c.id === 'https://abcd.localhost/') + + t.equal(connection?.headers?.authorization, `Basic ${Buffer.from('elastic:changeme').toString('base64')}`) + t.same(connection?.tls, { secureProtocol: 'TLSv1_2_method' }) + t.equal(connection?.url.hostname, 'abcd.localhost') + t.equal(connection?.url.protocol, 'https:') t.end() })