Skip to content

Commit 467c846

Browse files
committed
test: remove hub.startSpan test
1 parent 285d5bd commit 467c846

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

packages/tracing/test/span.test.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -320,50 +320,6 @@ describe('Span', () => {
320320
expect(spanTwo.toJSON().parent_span_id).toEqual(transaction.toJSON().span_id);
321321
});
322322
});
323-
324-
describe('hub.startSpan', () => {
325-
test('finish a transaction', () => {
326-
const spy = jest.spyOn(hub as any, 'captureEvent') as any;
327-
// @ts-ignore
328-
const transaction = hub.startSpan({ name: 'test' });
329-
transaction.finish();
330-
expect(spy).toHaveBeenCalled();
331-
expect(spy.mock.calls[0][0].spans).toHaveLength(0);
332-
expect(spy.mock.calls[0][0].timestamp).toBeTruthy();
333-
expect(spy.mock.calls[0][0].start_timestamp).toBeTruthy();
334-
expect(spy.mock.calls[0][0].contexts.trace).toEqual(transaction.getTraceContext());
335-
});
336-
337-
test('finish a transaction (deprecated way)', () => {
338-
const spy = jest.spyOn(hub as any, 'captureEvent') as any;
339-
// @ts-ignore
340-
const transaction = hub.startSpan({ transaction: 'test' });
341-
transaction.finish();
342-
expect(spy).toHaveBeenCalled();
343-
expect(spy.mock.calls[0][0].spans).toHaveLength(0);
344-
expect(spy.mock.calls[0][0].timestamp).toBeTruthy();
345-
expect(spy.mock.calls[0][0].start_timestamp).toBeTruthy();
346-
expect(spy.mock.calls[0][0].contexts.trace).toEqual(transaction.getTraceContext());
347-
});
348-
349-
test('startSpan with Span on the Scope should be a child', () => {
350-
const spy = jest.spyOn(hub as any, 'captureEvent') as any;
351-
const transaction = hub.startTransaction({ name: 'test' });
352-
const child1 = transaction.startChild();
353-
hub.configureScope(scope => {
354-
scope.setSpan(child1);
355-
});
356-
357-
const child2 = hub.startSpan({});
358-
child1.finish();
359-
child2.finish();
360-
transaction.finish();
361-
362-
expect(spy).toHaveBeenCalled();
363-
expect(spy.mock.calls[0][0].spans).toHaveLength(2);
364-
expect(child2.parentSpanId).toEqual(child1.spanId);
365-
});
366-
});
367323
});
368324

369325
describe('getTraceContext', () => {

0 commit comments

Comments
 (0)