Skip to content

Commit a711e6c

Browse files
committed
span clean up
1 parent 6fc3b38 commit a711e6c

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

packages/core/test/lib/tracing/span.test.ts

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -86,40 +86,6 @@ describe('span', () => {
8686
expect(span.tags['http.status_code']).toBe('404');
8787
expect(span.data['http.response.status_code']).toBe(404);
8888
});
89-
90-
// TODO (v8): Remove
91-
test('isSuccess', () => {
92-
const span = new SentrySpan({});
93-
expect(span.isSuccess()).toBe(false);
94-
expect(spanToJSON(span).status).not.toBe('ok');
95-
span.setHttpStatus(200);
96-
expect(span.isSuccess()).toBe(true);
97-
expect(spanToJSON(span).status).toBe('ok');
98-
span.setStatus('permission_denied');
99-
expect(span.isSuccess()).toBe(false);
100-
expect(spanToJSON(span).status).not.toBe('ok');
101-
span.setHttpStatus(0);
102-
expect(span.isSuccess()).toBe(false);
103-
expect(spanToJSON(span).status).not.toBe('ok');
104-
span.setHttpStatus(-1);
105-
expect(span.isSuccess()).toBe(false);
106-
expect(spanToJSON(span).status).not.toBe('ok');
107-
span.setHttpStatus(99);
108-
expect(span.isSuccess()).toBe(false);
109-
expect(spanToJSON(span).status).not.toBe('ok');
110-
span.setHttpStatus(100);
111-
expect(span.isSuccess()).toBe(true);
112-
expect(spanToJSON(span).status).toBe('ok');
113-
});
114-
});
115-
116-
describe('toTraceparent', () => {
117-
test('simple', () => {
118-
expect(new SentrySpan().toTraceparent()).toMatch(TRACEPARENT_REGEXP);
119-
});
120-
test('with sample', () => {
121-
expect(new SentrySpan({ sampled: true }).toTraceparent()).toMatch(TRACEPARENT_REGEXP);
122-
});
12389
});
12490

12591
describe('toJSON', () => {
@@ -278,8 +244,8 @@ describe('span', () => {
278244
expect(span.spanContext().traceId).toBe('c');
279245
expect(span.spanContext().spanId).toBe('d');
280246
expect(span.sampled).toBe(true);
281-
expect(span.description).toBe(undefined);
282-
expect(span.op).toBe(undefined);
247+
expect(spanToJSON(span).description).toBe(undefined);
248+
expect(spanToJSON(span).op).toBe(undefined);
283249
expect(span.tags).toStrictEqual({});
284250
});
285251

@@ -315,9 +281,9 @@ describe('span', () => {
315281

316282
expect(span.spanContext().traceId).toBe('a');
317283
expect(span.spanContext().spanId).toBe('b');
318-
expect(span.description).toBe('new');
284+
expect(spanToJSON(span).description).toBe('new');
319285
expect(spanToJSON(span).timestamp).toBe(1);
320-
expect(span.op).toBe('new-op');
286+
expect(spanToJSON(span).op).toBe('new-op');
321287
expect(span.sampled).toBe(true);
322288
expect(span.tags).toStrictEqual({ tag1: 'bye' });
323289
expect(span.data).toStrictEqual({

0 commit comments

Comments
 (0)