@@ -4,7 +4,6 @@ import { ROOT_CONTEXT } from '@opentelemetry/api';
44import { SpanKind } from '@opentelemetry/api' ;
55import { TraceFlags , context , trace } from '@opentelemetry/api' ;
66import type { ReadableSpan } from '@opentelemetry/sdk-trace-base' ;
7- import { Span as SpanClass } from '@opentelemetry/sdk-trace-base' ;
87import {
98 SEMANTIC_ATTRIBUTE_SENTRY_OP ,
109 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
@@ -32,6 +31,8 @@ import { getSpanKind } from '../src/utils/getSpanKind';
3231import { makeTraceState } from '../src/utils/makeTraceState' ;
3332import { spanHasAttributes , spanHasName } from '../src/utils/spanTypes' ;
3433import { cleanupOtel , mockSdkInit } from './helpers/mockSdkInit' ;
34+ import { isSpan } from './helpers/isSpan' ;
35+ import { INSPECT_MAX_BYTES } from 'buffer' ;
3536
3637describe ( 'trace' , ( ) => {
3738 beforeEach ( ( ) => {
@@ -537,7 +538,7 @@ describe('trace', () => {
537538 return span ;
538539 } ) ;
539540
540- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
541+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
541542 } ) ;
542543
543544 it ( 'creates a span if there is a parent' , ( ) => {
@@ -549,7 +550,7 @@ describe('trace', () => {
549550 return span ;
550551 } ) ;
551552
552- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
553+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
553554 } ) ;
554555 } ) ;
555556 } ) ;
@@ -829,7 +830,7 @@ describe('trace', () => {
829830 it ( 'does not create a span if there is no parent' , ( ) => {
830831 const span = startInactiveSpan ( { name : 'test span' , onlyIfParent : true } ) ;
831832
832- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
833+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
833834 } ) ;
834835
835836 it ( 'creates a span if there is a parent' , ( ) => {
@@ -839,7 +840,7 @@ describe('trace', () => {
839840 return span ;
840841 } ) ;
841842
842- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
843+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
843844 } ) ;
844845 } ) ;
845846
@@ -1199,7 +1200,7 @@ describe('trace', () => {
11991200 return span ;
12001201 } ) ;
12011202
1202- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
1203+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
12031204 } ) ;
12041205
12051206 it ( 'creates a span if there is a parent' , ( ) => {
@@ -1211,7 +1212,7 @@ describe('trace', () => {
12111212 return span ;
12121213 } ) ;
12131214
1214- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
1215+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
12151216 } ) ;
12161217 } ) ;
12171218 } ) ;
0 commit comments