From d8d36479446497c32b22904713ba746ab8edf509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Mon, 20 Nov 2023 14:24:40 -0800 Subject: [PATCH] actually fix test --- packages/compat/package.json | 1 + packages/compat/test/index.test.ts | 15 ++++++++++++--- yarn.lock | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/compat/package.json b/packages/compat/package.json index 1a73ae82..52641f20 100644 --- a/packages/compat/package.json +++ b/packages/compat/package.json @@ -47,6 +47,7 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/sdk-trace-base": "~1.18.1", "@opentelemetry/sdk-trace-node": "~1.18.1", + "@opentelemetry/semantic-conventions": "~1.18.1", "@solarwinds-apm/eslint-config": "workspace:^", "@solarwinds-apm/rollup-config": "workspace:^", "@solarwinds-apm/test": "workspace:^", diff --git a/packages/compat/test/index.test.ts b/packages/compat/test/index.test.ts index b99f21e8..157a8795 100644 --- a/packages/compat/test/index.test.ts +++ b/packages/compat/test/index.test.ts @@ -106,7 +106,10 @@ describe("instrument", () => { code: SpanStatusCode.ERROR, message: "error", }) - expect(span?.attributes).to.have.property( + expect(span?.events[0]!.attributes).to.include({ + [SemanticAttributes.EXCEPTION_MESSAGE]: "error", + }) + expect(span?.events[0]!.attributes).to.have.property( SemanticAttributes.EXCEPTION_STACKTRACE, ) }) @@ -151,7 +154,10 @@ describe("instrument", () => { code: SpanStatusCode.ERROR, message: "error", }) - expect(span?.attributes).to.have.property( + expect(span?.events[0]!.attributes).to.include({ + [SemanticAttributes.EXCEPTION_MESSAGE]: "error", + }) + expect(span?.events[0]!.attributes).to.have.property( SemanticAttributes.EXCEPTION_STACKTRACE, ) }) @@ -247,7 +253,10 @@ describe("pInstrument", () => { code: SpanStatusCode.ERROR, message: "error", }) - expect(span?.attributes).to.have.property( + expect(span?.events[0]!.attributes).to.include({ + [SemanticAttributes.EXCEPTION_MESSAGE]: "error", + }) + expect(span?.events[0]!.attributes).to.have.property( SemanticAttributes.EXCEPTION_STACKTRACE, ) }) diff --git a/yarn.lock b/yarn.lock index c4473e38..096daabf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1826,6 +1826,7 @@ __metadata: "@opentelemetry/api": "npm:^1.3.0" "@opentelemetry/sdk-trace-base": "npm:~1.18.1" "@opentelemetry/sdk-trace-node": "npm:~1.18.1" + "@opentelemetry/semantic-conventions": "npm:~1.18.1" "@solarwinds-apm/eslint-config": "workspace:^" "@solarwinds-apm/rollup-config": "workspace:^" "@solarwinds-apm/test": "workspace:^"