From ba9fafac1f38a93c0f4d36fb9db63d33ba8ec347 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Fri, 6 Dec 2024 14:35:59 +0000 Subject: [PATCH] Make ESM test standalone --- .../node/opentelemetry-instrumentation-pg/test/pg.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts index bc58bbbd4e..ecb9e6c7fd 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts @@ -160,6 +160,7 @@ describe('pg', () => { if (testPostgresLocally) { testUtils.cleanUpDocker('postgres'); } + await client.end(); }); @@ -1087,7 +1088,9 @@ describe('pg', () => { }); }); }); +}); +describe('pg (ESM)', () => { it('should work with ESM usage', async () => { await testUtils.runTestFixture({ cwd: __dirname, @@ -1109,7 +1112,7 @@ describe('pg', () => { assert.strictEqual(spans[0].kind, 3); assert.strictEqual(spans[1].name, 'test-span'); assert.strictEqual(spans[1].kind, 1); - assert.strictEqual(spans[2].name, 'pg.query:SELECT postgres'); + assert.strictEqual(spans[2].name, 'pg.query:SELECT otel_pg_database'); assert.strictEqual(spans[2].kind, 3); }, });