Skip to content

Commit 8ff5f09

Browse files
committed
Add middie spans back to e2e tests
1 parent 964cf0c commit 8ff5f09

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,41 @@ test('Sends an API route transaction', async ({ baseURL }) => {
4949
expect(transactionEvent).toEqual(
5050
expect.objectContaining({
5151
spans: expect.arrayContaining([
52+
{
53+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
54+
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
55+
data: {
56+
'sentry.origin': 'manual',
57+
'service.name': 'fastify',
58+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - onRequest',
59+
'fastify.type': 'hook',
60+
'hook.callback.name': 'runMiddie',
61+
},
62+
description: 'handler - runMiddie',
63+
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
64+
start_timestamp: expect.any(Number),
65+
timestamp: expect.any(Number),
66+
status: 'ok',
67+
origin: 'manual',
68+
},
69+
{
70+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
71+
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
72+
data: {
73+
'sentry.origin': 'manual',
74+
'service.name': 'fastify',
75+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - route-handler',
76+
'fastify.type': 'request-handler',
77+
'http.route': '/test-transaction',
78+
'hook.callback.name': 'anonymous',
79+
},
80+
description: 'handler - fastify -> @fastify/otel -> @fastify/middie',
81+
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
82+
start_timestamp: expect.any(Number),
83+
timestamp: expect.any(Number),
84+
status: 'ok',
85+
origin: 'manual',
86+
},
5287
{
5388
span_id: expect.stringMatching(/[a-f0-9]{16}/),
5489
trace_id: expect.stringMatching(/[a-f0-9]{32}/),

0 commit comments

Comments
 (0)