@@ -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,7 @@ 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' ; 
3535
3636describe ( 'trace' ,  ( )  =>  { 
3737  beforeEach ( ( )  =>  { 
@@ -537,7 +537,7 @@ describe('trace', () => {
537537          return  span ; 
538538        } ) ; 
539539
540-         expect ( span ) . not . toBeInstanceOf ( SpanClass ) ; 
540+         expect ( isSpan ( span ) ) . toEqual ( false ) ; 
541541      } ) ; 
542542
543543      it ( 'creates a span if there is a parent' ,  ( )  =>  { 
@@ -549,7 +549,7 @@ describe('trace', () => {
549549          return  span ; 
550550        } ) ; 
551551
552-         expect ( span ) . toBeInstanceOf ( SpanClass ) ; 
552+         expect ( isSpan ( span ) ) . toEqual ( true ) ; 
553553      } ) ; 
554554    } ) ; 
555555  } ) ; 
@@ -829,7 +829,7 @@ describe('trace', () => {
829829      it ( 'does not create a span if there is no parent' ,  ( )  =>  { 
830830        const  span  =  startInactiveSpan ( {  name : 'test span' ,  onlyIfParent : true  } ) ; 
831831
832-         expect ( span ) . not . toBeInstanceOf ( SpanClass ) ; 
832+         expect ( isSpan ( span ) ) . toEqual ( false ) ; 
833833      } ) ; 
834834
835835      it ( 'creates a span if there is a parent' ,  ( )  =>  { 
@@ -839,7 +839,7 @@ describe('trace', () => {
839839          return  span ; 
840840        } ) ; 
841841
842-         expect ( span ) . toBeInstanceOf ( SpanClass ) ; 
842+         expect ( isSpan ( span ) ) . toEqual ( true ) ; 
843843      } ) ; 
844844    } ) ; 
845845
@@ -1199,7 +1199,7 @@ describe('trace', () => {
11991199          return  span ; 
12001200        } ) ; 
12011201
1202-         expect ( span ) . not . toBeInstanceOf ( SpanClass ) ; 
1202+         expect ( isSpan ( span ) ) . toEqual ( false ) ; 
12031203      } ) ; 
12041204
12051205      it ( 'creates a span if there is a parent' ,  ( )  =>  { 
@@ -1211,7 +1211,7 @@ describe('trace', () => {
12111211          return  span ; 
12121212        } ) ; 
12131213
1214-         expect ( span ) . toBeInstanceOf ( SpanClass ) ; 
1214+         expect ( isSpan ( span ) ) . toEqual ( true ) ; 
12151215      } ) ; 
12161216    } ) ; 
12171217  } ) ; 
0 commit comments