-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathrequest-instrumentation.test.ts
More file actions
24 lines (21 loc) · 1.01 KB
/
request-instrumentation.test.ts
File metadata and controls
24 lines (21 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { expect, test } from '@playwright/test';
import { waitForTransaction } from '@sentry-internal/test-utils';
// Note(lforst): I officially declare bancruptcy on this test. I tried a million ways to make it work but it kept flaking.
// Sometimes the request span was included in the handler span, more often it wasn't. I have no idea why. Maybe one day we will
// figure it out. Today is not that day.
test.skip('Should send a transaction with a http span', async ({ request }) => {
const transactionPromise = waitForTransaction('nextjs-app-dir', async transactionEvent => {
return transactionEvent?.transaction === 'GET /api/request-instrumentation';
});
await request.get('/api/request-instrumentation');
expect((await transactionPromise).spans).toContainEqual(
expect.objectContaining({
data: expect.objectContaining({
'http.method': 'GET',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.client',
}),
description: 'GET https://example.com/',
}),
);
});