1
1
import { EventEnvelope , EventItem } from '@sentry/types' ;
2
2
import { createEnvelope , serializeEnvelope } from '@sentry/utils' ;
3
3
4
- import { makeNewXHRTransport , XHRTransportOptions } from '../../../src/transports/xhr' ;
4
+ import { makeXHRTransport , XHRTransportOptions } from '../../../src/transports/xhr' ;
5
5
6
6
const DEFAULT_XHR_TRANSPORT_OPTIONS : XHRTransportOptions = {
7
7
url : 'https://sentry.io/api/42/store/?sentry_key=123&sentry_version=7' ,
@@ -52,7 +52,7 @@ describe('NewXHRTransport', () => {
52
52
} ) ;
53
53
54
54
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 ) ;
56
56
expect ( xhrMock . open ) . toHaveBeenCalledTimes ( 0 ) ;
57
57
expect ( xhrMock . setRequestHeader ) . toHaveBeenCalledTimes ( 0 ) ;
58
58
expect ( xhrMock . send ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -66,7 +66,7 @@ describe('NewXHRTransport', () => {
66
66
} ) ;
67
67
68
68
it ( 'returns the correct response' , async ( ) => {
69
- const transport = makeNewXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
69
+ const transport = makeXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
70
70
71
71
const [ res ] = await Promise . all ( [
72
72
transport . send ( ERROR_ENVELOPE ) ,
@@ -78,7 +78,7 @@ describe('NewXHRTransport', () => {
78
78
} ) ;
79
79
80
80
it ( 'sets rate limit response headers' , async ( ) => {
81
- const transport = makeNewXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
81
+ const transport = makeXHRTransport ( DEFAULT_XHR_TRANSPORT_OPTIONS ) ;
82
82
83
83
await Promise . all ( [ transport . send ( ERROR_ENVELOPE ) , ( xhrMock as XMLHttpRequest ) . onreadystatechange ! ( { } as Event ) ] ) ;
84
84
@@ -98,7 +98,7 @@ describe('NewXHRTransport', () => {
98
98
headers,
99
99
} ;
100
100
101
- const transport = makeNewXHRTransport ( options ) ;
101
+ const transport = makeXHRTransport ( options ) ;
102
102
await Promise . all ( [ transport . send ( ERROR_ENVELOPE ) , ( xhrMock as XMLHttpRequest ) . onreadystatechange ! ( { } as Event ) ] ) ;
103
103
104
104
expect ( xhrMock . setRequestHeader ) . toHaveBeenCalledTimes ( 3 ) ;
0 commit comments