Skip to content

Commit 38e5c4b

Browse files
committed
fix: more tests with string/array confusion
1 parent b76ec38 commit 38e5c4b

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

dev-packages/e2e-tests/test-applications/node-fastify-6/tests/propagation.test.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
9191
'server.port': { value: 3030, type: 'integer' },
9292
'http.response.status_text': { value: 'OK', type: 'string' },
9393
'http.route': { value: '/test-outgoing-http/:id', type: 'string' },
94-
'http.request.header.accept': { value: '*/*', type: 'string' },
95-
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
96-
'http.request.header.accept-language': { value: '*', type: 'string' },
97-
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
98-
'http.request.header.host': { value: 'localhost:3030', type: 'string' },
99-
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
100-
'http.request.header.user-agent': { value: 'node', type: 'string' },
94+
'http.request.header.accept': { value: ['*/*'], type: 'array' },
95+
'http.request.header.accept-encoding': { value: ['gzip, deflate'], type: 'array' },
96+
'http.request.header.accept-language': { value: ['*'], type: 'array' },
97+
'http.request.header.connection': { value: ['keep-alive'], type: 'array' },
98+
'http.request.header.host': { value: ['localhost:3030'], type: 'array' },
99+
'http.request.header.sec-fetch-mode': { value: ['cors'], type: 'array' },
100+
'http.request.header.user-agent': { value: ['node'], type: 'array' },
101101
}),
102102
}),
103103
);
@@ -131,12 +131,12 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
131131
'server.port': { value: 3030, type: 'integer' },
132132
'http.response.status_text': { value: 'OK', type: 'string' },
133133
'http.route': { value: '/test-inbound-headers/:id', type: 'string' },
134-
'http.request.header.baggage': { value: expect.any(String), type: 'string' },
135-
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
136-
'http.request.header.host': { value: expect.any(String), type: 'string' },
134+
'http.request.header.baggage': { value: [expect.any(String)], type: 'array' },
135+
'http.request.header.connection': { value: ['keep-alive'], type: 'array' },
136+
'http.request.header.host': { value: [expect.any(String)], type: 'array' },
137137
'http.request.header.sentry-trace': {
138-
value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/),
139-
type: 'string',
138+
value: [expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/)],
139+
type: 'array',
140140
},
141141
}),
142142
}),
@@ -232,13 +232,13 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
232232
'server.port': { value: 3030, type: 'integer' },
233233
'http.response.status_text': { value: 'OK', type: 'string' },
234234
'http.route': { value: '/test-outgoing-fetch/:id', type: 'string' },
235-
'http.request.header.accept': { value: '*/*', type: 'string' },
236-
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
237-
'http.request.header.accept-language': { value: '*', type: 'string' },
238-
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
239-
'http.request.header.host': { value: expect.any(String), type: 'string' },
240-
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
241-
'http.request.header.user-agent': { value: 'node', type: 'string' },
235+
'http.request.header.accept': { value: ['*/*'], type: 'array' },
236+
'http.request.header.accept-encoding': { value: ['gzip, deflate'], type: 'array' },
237+
'http.request.header.accept-language': { value: ['*'], type: 'array' },
238+
'http.request.header.connection': { value: ['keep-alive'], type: 'array' },
239+
'http.request.header.host': { value: [expect.any(String)], type: 'array' },
240+
'http.request.header.sec-fetch-mode': { value: ['cors'], type: 'array' },
241+
'http.request.header.user-agent': { value: ['node'], type: 'array' },
242242
}),
243243
}),
244244
);
@@ -273,18 +273,18 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
273273
'http.response.status_text': { value: 'OK', type: 'string' },
274274
'user_agent.original': { value: 'node', type: 'string' },
275275
'http.route': { value: '/test-inbound-headers/:id', type: 'string' },
276-
'http.request.header.accept': { value: '*/*', type: 'string' },
277-
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
278-
'http.request.header.accept-language': { value: '*', type: 'string' },
279-
'http.request.header.baggage': { value: expect.any(String), type: 'string' },
280-
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
281-
'http.request.header.host': { value: expect.any(String), type: 'string' },
282-
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
276+
'http.request.header.accept': { value: ['*/*'], type: 'array' },
277+
'http.request.header.accept-encoding': { value: ['gzip, deflate'], type: 'array' },
278+
'http.request.header.accept-language': { value: ['*'], type: 'array' },
279+
'http.request.header.baggage': { value: [expect.any(String)], type: 'array' },
280+
'http.request.header.connection': { value: ['keep-alive'], type: 'array' },
281+
'http.request.header.host': { value: [expect.any(String)], type: 'array' },
282+
'http.request.header.sec-fetch-mode': { value: ['cors'], type: 'array' },
283283
'http.request.header.sentry-trace': {
284-
value: expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/),
285-
type: 'string',
284+
value: [expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-1/)],
285+
type: 'array',
286286
},
287-
'http.request.header.user-agent': { value: 'node', type: 'string' },
287+
'http.request.header.user-agent': { value: ['node'], type: 'array' },
288288
}),
289289
}),
290290
);

dev-packages/e2e-tests/test-applications/node-fastify-6/tests/spans.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ test('Sends an API route span', async ({ baseURL }) => {
4444
'server.port': { value: 3030, type: 'integer' },
4545
'http.response.status_text': { value: 'OK', type: 'string' },
4646
'http.route': { value: '/test-transaction', type: 'string' },
47-
'http.request.header.accept': { value: '*/*', type: 'string' },
48-
'http.request.header.accept-encoding': { value: 'gzip, deflate', type: 'string' },
49-
'http.request.header.accept-language': { value: '*', type: 'string' },
50-
'http.request.header.connection': { value: 'keep-alive', type: 'string' },
51-
'http.request.header.host': { value: expect.any(String), type: 'string' },
52-
'http.request.header.sec-fetch-mode': { value: 'cors', type: 'string' },
53-
'http.request.header.user-agent': { value: 'node', type: 'string' },
47+
'http.request.header.accept': { value: ['*/*'], type: 'array' },
48+
'http.request.header.accept-encoding': { value: ['gzip, deflate'], type: 'array' },
49+
'http.request.header.accept-language': { value: ['*'], type: 'array' },
50+
'http.request.header.connection': { value: ['keep-alive'], type: 'array' },
51+
'http.request.header.host': { value: [expect.any(String)], type: 'array' },
52+
'http.request.header.sec-fetch-mode': { value: ['cors'], type: 'array' },
53+
'http.request.header.user-agent': { value: ['node'], type: 'array' },
5454
}),
5555
}),
5656
);
@@ -139,8 +139,8 @@ test('Captures request metadata', async ({ baseURL }) => {
139139
expect.stringMatching(/^http:\/\/localhost:(\d+)\/test-post$/),
140140
);
141141
expect(segmentEvent.attributes['http.request.method']?.value).toEqual('POST');
142-
expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual(expect.stringContaining(''));
143-
expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual('application/json');
142+
expect(segmentEvent.attributes['http.request.header.user-agent']?.value).toEqual([expect.stringContaining('')]);
143+
expect(segmentEvent.attributes['http.request.header.content-type']?.value).toEqual(['application/json']);
144144

145145
expect(segmentEvent.attributes['http.request.body.data']?.value).toBe(JSON.stringify({ foo: 'bar', other: 1 }));
146146
expect(segmentEvent.attributes['user.ip_address']?.value).toEqual('::1');

0 commit comments

Comments
 (0)