Skip to content

Commit 5329aaa

Browse files
committed
Add middie spans back to e2e tests
1 parent 964cf0c commit 5329aaa

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,61 @@ 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+
'sentry.op': 'http',
58+
'service.name': 'fastify',
59+
'fastify.root': '@fastify/otel',
60+
'http.route': '/test-transaction',
61+
'http.request.method': 'GET',
62+
'http.response.status_code': 200,
63+
},
64+
description: 'request',
65+
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
66+
start_timestamp: expect.any(Number),
67+
timestamp: expect.any(Number),
68+
status: 'ok',
69+
op: 'http',
70+
origin: 'manual',
71+
},
72+
{
73+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
74+
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
75+
data: {
76+
'sentry.origin': 'manual',
77+
'service.name': 'fastify',
78+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - onRequest',
79+
'fastify.type': 'hook',
80+
'hook.callback.name': 'runMiddie',
81+
},
82+
description: 'handler - runMiddie',
83+
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
84+
start_timestamp: expect.any(Number),
85+
timestamp: expect.any(Number),
86+
status: 'ok',
87+
origin: 'manual',
88+
},
89+
{
90+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
91+
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
92+
data: {
93+
'sentry.origin': 'manual',
94+
'service.name': 'fastify',
95+
'hook.name': 'fastify -> @fastify/otel -> @fastify/middie - route-handler',
96+
'fastify.type': 'request-handler',
97+
'http.route': '/test-transaction',
98+
'hook.callback.name': 'anonymous',
99+
},
100+
description: 'handler - fastify -> @fastify/otel -> @fastify/middie',
101+
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
102+
start_timestamp: expect.any(Number),
103+
timestamp: expect.any(Number),
104+
status: 'ok',
105+
origin: 'manual',
106+
},
52107
{
53108
span_id: expect.stringMatching(/[a-f0-9]{16}/),
54109
trace_id: expect.stringMatching(/[a-f0-9]{32}/),

0 commit comments

Comments
 (0)