-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathtest.ts
27 lines (22 loc) · 867 Bytes
/
test.ts
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
import { cleanupChildProcesses, createRunner } from '../../../../utils/runner';
afterAll(() => {
cleanupChildProcesses();
});
test('should send manually started parallel root spans outside of root context', done => {
expect.assertions(6);
createRunner(__dirname, 'scenario.ts')
.expect({ transaction: { transaction: 'test_span_1' } })
.expect({
transaction: transaction => {
expect(transaction).toBeDefined();
const traceId = transaction.contexts?.trace?.trace_id;
expect(traceId).toBeDefined();
expect(transaction.contexts?.trace?.parent_span_id).toBeUndefined();
const trace1Id = transaction.contexts?.trace?.data?.spanIdTraceId;
expect(trace1Id).toBeDefined();
// Different trace ID as the first span
expect(trace1Id).not.toBe(traceId);
},
})
.start(done);
});