@@ -392,32 +392,18 @@ describe('callbacks', () => {
392
392
} ) ;
393
393
394
394
// TODO (v8): Adapt these tests once we remove `tracingOrigins`
395
- describe ( '[pre-v8]: shouldAttachHeaders' , ( ) => {
396
- describe ( 'prefer `tracePropagationTargets` over `tracingOrigins` ' , ( ) => {
395
+ describe ( 'shouldAttachHeaders' , ( ) => {
396
+ describe ( 'should prefer `tracePropagationTargets` over defaults ' , ( ) => {
397
397
it ( 'should return `true` if the url matches the new tracePropagationTargets' , ( ) => {
398
- expect ( shouldAttachHeaders ( 'http://example.com' , [ 'example.com' ] , undefined ) ) . toBe ( true ) ;
398
+ expect ( shouldAttachHeaders ( 'http://example.com' , [ 'example.com' ] ) ) . toBe ( true ) ;
399
399
} ) ;
400
400
401
401
it ( 'should return `false` if tracePropagationTargets array is empty' , ( ) => {
402
- expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , [ ] , [ 'localhost' ] ) ) . toBe ( false ) ;
402
+ expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , [ ] ) ) . toBe ( false ) ;
403
403
} ) ;
404
404
405
405
it ( "should return `false` if tracePropagationTargets array doesn't match" , ( ) => {
406
- expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , [ 'example.com' ] , [ 'localhost' ] ) ) . toBe ( false ) ;
407
- } ) ;
408
- } ) ;
409
-
410
- describe ( 'tracingOrigins backwards compatibility (tracePropagationTargets not defined)' , ( ) => {
411
- it ( 'should return `true` if the url matches tracingOrigns' , ( ) => {
412
- expect ( shouldAttachHeaders ( 'http://example.com' , undefined , [ 'example.com' ] ) ) . toBe ( true ) ;
413
- } ) ;
414
-
415
- it ( 'should return `false` if tracePropagationTargets array is empty' , ( ) => {
416
- expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , undefined , [ ] ) ) . toBe ( false ) ;
417
- } ) ;
418
-
419
- it ( "should return `false` if tracePropagationTargets array doesn't match" , ( ) => {
420
- expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , undefined , [ 'example.com' ] ) ) . toBe ( false ) ;
406
+ expect ( shouldAttachHeaders ( 'http://localhost:3000/test' , [ 'example.com' ] ) ) . toBe ( false ) ;
421
407
} ) ;
422
408
} ) ;
423
409
@@ -428,11 +414,11 @@ describe('[pre-v8]: shouldAttachHeaders', () => {
428
414
'http://somewhere.com/test/localhost/123' ,
429
415
'http://somewhere.com/test?url=localhost:3000&test=123' ,
430
416
] ) ( 'return `true` for urls matching defaults (%s)' , url => {
431
- expect ( shouldAttachHeaders ( url , undefined , undefined ) ) . toBe ( true ) ;
417
+ expect ( shouldAttachHeaders ( url , undefined ) ) . toBe ( true ) ;
432
418
} ) ;
433
419
434
420
it . each ( [ 'notmydoman/api/test' , 'example.com' ] ) ( 'return `false` for urls not matching defaults (%s)' , url => {
435
- expect ( shouldAttachHeaders ( url , undefined , undefined ) ) . toBe ( false ) ;
421
+ expect ( shouldAttachHeaders ( url , undefined ) ) . toBe ( false ) ;
436
422
} ) ;
437
423
} ) ;
438
424
} ) ;
0 commit comments