11import { EventEnvelope , EventItem } from '@sentry/types' ;
22import { createEnvelope , serializeEnvelope } from '@sentry/utils' ;
33
4- import { makeNewXHRTransport , XHRTransportOptions } from '../../../src/transports/xhr' ;
4+ import { makeXHRTransport , XHRTransportOptions } from '../../../src/transports/xhr' ;
55
66const DEFAULT_XHR_TRANSPORT_OPTIONS : XHRTransportOptions = {
77 url : 'https://sentry.io/api/42/store/?sentry_key=123&sentry_version=7' ,
@@ -52,7 +52,7 @@ describe('NewXHRTransport', () => {
5252 } ) ;
5353
5454 it ( 'makes an XHR request to the given URL' , async ( ) => {
55- const transport = makeNewXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
55+ const transport = makeXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
5656 expect ( xhrMock . open ) . toHaveBeenCalledTimes ( 0 ) ;
5757 expect ( xhrMock . setRequestHeader ) . toHaveBeenCalledTimes ( 0 ) ;
5858 expect ( xhrMock . send ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -66,7 +66,7 @@ describe('NewXHRTransport', () => {
6666 } ) ;
6767
6868 it ( 'returns the correct response' , async ( ) => {
69- const transport = makeNewXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
69+ const transport = makeXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
7070
7171 const [ res ] = await Promise . all ( [
7272 transport . send ( ERROR_ENVELOPE ) ,
@@ -78,7 +78,7 @@ describe('NewXHRTransport', () => {
7878 } ) ;
7979
8080 it ( 'sets rate limit response headers' , async ( ) => {
81- const transport = makeNewXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
81+ const transport = makeXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
8282
8383 await Promise . all ( [ transport . send ( ERROR_ENVELOPE ) , ( xhrMock as XMLHttpRequest ) . onreadystatechange ! ( { } as Event ) ] ) ;
8484
@@ -98,7 +98,7 @@ describe('NewXHRTransport', () => {
9898 headers,
9999 } ;
100100
101- const transport = makeNewXHRTransport ( options ) ;
101+ const transport = makeXHRTransport ( options ) ;
102102 await Promise . all ( [ transport . send ( ERROR_ENVELOPE ) , ( xhrMock as XMLHttpRequest ) . onreadystatechange ! ( { } as Event ) ] ) ;
103103
104104 expect ( xhrMock . setRequestHeader ) . toHaveBeenCalledTimes ( 3 ) ;
0 commit comments