-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
29 lines (25 loc) · 842 Bytes
/
test.ts
File metadata and controls
29 lines (25 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { createTestServer } from '@sentry-internal/test-utils';
import { expect, test } from 'vitest';
import { createRunner } from '../../../../utils/runner';
test('infers sentry.op for streamed outgoing fetch spans', async () => {
expect.assertions(2);
const [SERVER_URL, closeTestServer] = await createTestServer()
.get('/api/v0', () => {
expect(true).toBe(true);
})
.start();
await createRunner(__dirname, 'scenario.ts')
.withEnv({ SERVER_URL })
.expect({
span: container => {
const httpClientSpan = container.items.find(
item =>
item.attributes?.['sentry.op']?.type === 'string' && item.attributes['sentry.op'].value === 'http.client',
);
expect(httpClientSpan).toBeDefined();
},
})
.start()
.completed();
closeTestServer();
});