Skip to content

Commit 72fee91

Browse files
committed
tests(inst-undici): fix test assertions
1 parent a263b4d commit 72fee91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/node/instrumentation-undici/test/undici.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ describe('UndiciInstrumentation `undici` tests', function () {
824824
'foo-client': 'bar',
825825
'user-agent': ['agent', 'other-agent'],
826826
},
827-
expectedUserAgent: 'agent',
827+
expectedUserAgent: 'other-agent',
828828
},
829829
{
830830
name: 'another header with value user-agent',

plugins/node/instrumentation-undici/test/utils/assertSpan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const assertSpan = (
171171
if (userAgent) {
172172
assert.strictEqual(
173173
span.attributes[SemanticAttributes.USER_AGENT_ORIGINAL],
174-
Array.isArray(userAgent) ? userAgent[0] : userAgent
174+
Array.isArray(userAgent) ? userAgent[userAgent.length -1] : userAgent
175175
);
176176
}
177177
}

0 commit comments

Comments
 (0)