@@ -4,7 +4,6 @@ import { ROOT_CONTEXT } from '@opentelemetry/api';
4
4
import { SpanKind } from '@opentelemetry/api' ;
5
5
import { TraceFlags , context , trace } from '@opentelemetry/api' ;
6
6
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base' ;
7
- import { Span as SpanClass } from '@opentelemetry/sdk-trace-base' ;
8
7
import {
9
8
SEMANTIC_ATTRIBUTE_SENTRY_OP ,
10
9
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
@@ -32,6 +31,7 @@ import { getSpanKind } from '../src/utils/getSpanKind';
32
31
import { makeTraceState } from '../src/utils/makeTraceState' ;
33
32
import { spanHasAttributes , spanHasName } from '../src/utils/spanTypes' ;
34
33
import { cleanupOtel , mockSdkInit } from './helpers/mockSdkInit' ;
34
+ import { isSpan } from './helpers/isSpan' ;
35
35
36
36
describe ( 'trace' , ( ) => {
37
37
beforeEach ( ( ) => {
@@ -537,7 +537,7 @@ describe('trace', () => {
537
537
return span ;
538
538
} ) ;
539
539
540
- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
540
+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
541
541
} ) ;
542
542
543
543
it ( 'creates a span if there is a parent' , ( ) => {
@@ -549,7 +549,7 @@ describe('trace', () => {
549
549
return span ;
550
550
} ) ;
551
551
552
- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
552
+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
553
553
} ) ;
554
554
} ) ;
555
555
} ) ;
@@ -829,7 +829,7 @@ describe('trace', () => {
829
829
it ( 'does not create a span if there is no parent' , ( ) => {
830
830
const span = startInactiveSpan ( { name : 'test span' , onlyIfParent : true } ) ;
831
831
832
- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
832
+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
833
833
} ) ;
834
834
835
835
it ( 'creates a span if there is a parent' , ( ) => {
@@ -839,7 +839,7 @@ describe('trace', () => {
839
839
return span ;
840
840
} ) ;
841
841
842
- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
842
+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
843
843
} ) ;
844
844
} ) ;
845
845
@@ -1199,7 +1199,7 @@ describe('trace', () => {
1199
1199
return span ;
1200
1200
} ) ;
1201
1201
1202
- expect ( span ) . not . toBeInstanceOf ( SpanClass ) ;
1202
+ expect ( isSpan ( span ) ) . toEqual ( false ) ;
1203
1203
} ) ;
1204
1204
1205
1205
it ( 'creates a span if there is a parent' , ( ) => {
@@ -1211,7 +1211,7 @@ describe('trace', () => {
1211
1211
return span ;
1212
1212
} ) ;
1213
1213
1214
- expect ( span ) . toBeInstanceOf ( SpanClass ) ;
1214
+ expect ( isSpan ( span ) ) . toEqual ( true ) ;
1215
1215
} ) ;
1216
1216
} ) ;
1217
1217
} ) ;
0 commit comments