@@ -152,11 +152,7 @@ describe('xhr', () => {
152
152
spyEntries . restore ( ) ;
153
153
} ;
154
154
155
- prepareData = (
156
- done : any ,
157
- fileUrl : string ,
158
- propagateTraceHeaderCorsUrls ?: any
159
- ) => {
155
+ prepareData = ( done : any , fileUrl : string , config ?: any ) => {
160
156
sandbox = sinon . createSandbox ( ) ;
161
157
const fakeXhr = sandbox . useFakeXMLHttpRequest ( ) ;
162
158
fakeXhr . onCreate = function ( xhr : any ) {
@@ -179,9 +175,7 @@ describe('xhr', () => {
179
175
180
176
spyEntries = sandbox . stub ( performance , 'getEntriesByType' ) ;
181
177
spyEntries . withArgs ( 'resource' ) . returns ( resources ) ;
182
- xmlHttpRequestPlugin = new XMLHttpRequestPlugin (
183
- propagateTraceHeaderCorsUrls
184
- ) ;
178
+ xmlHttpRequestPlugin = new XMLHttpRequestPlugin ( config ) ;
185
179
webTracerProviderWithZone = new WebTracerProvider ( {
186
180
logLevel : LogLevel . ERROR ,
187
181
plugins : [ xmlHttpRequestPlugin ] ,
@@ -460,6 +454,25 @@ describe('xhr', () => {
460
454
) ;
461
455
} ) ;
462
456
457
+ describe ( 'when url is ignored' , ( ) => {
458
+ beforeEach ( done => {
459
+ clearData ( ) ;
460
+ const propagateTraceHeaderCorsUrls = url ;
461
+ prepareData ( done , url , {
462
+ propagateTraceHeaderCorsUrls,
463
+ ignoreUrls : [ propagateTraceHeaderCorsUrls ] ,
464
+ } ) ;
465
+ } ) ;
466
+
467
+ it ( 'should NOT create any span' , ( ) => {
468
+ assert . strictEqual (
469
+ exportSpy . args . length ,
470
+ 0 ,
471
+ "span shouldn't be exported"
472
+ ) ;
473
+ } ) ;
474
+ } ) ;
475
+
463
476
describe ( 'AND origin match with window.location' , ( ) => {
464
477
beforeEach ( done => {
465
478
clearData ( ) ;
0 commit comments