-
-
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) · 1018 Bytes
/
test.ts
File metadata and controls
29 lines (25 loc) · 1018 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 { afterAll, describe, expect } from 'vitest';
import { cleanupChildProcesses, createEsmAndCjsTests } from '../../../utils/runner';
describe('http.client span with streaming enabled', () => {
afterAll(() => {
cleanupChildProcesses();
});
createEsmAndCjsTests(__dirname, 'scenario-fetch.mjs', 'instrument.mjs', (createRunner, test) => {
test('sends http.client span without a local parent when span streaming is enabled', async () => {
const runner = createRunner()
.expect({
span: span => {
const httpClientSpan = span.items.find(item =>
item.attributes?.['sentry.op']
? item.attributes['sentry.op'].type === 'string' && item.attributes['sentry.op'].value === 'http.client'
: false,
);
expect(httpClientSpan).toBeDefined();
expect(httpClientSpan?.name).toMatch(/^GET .*\/external$/);
},
})
.start();
await runner.completed();
});
});
});