1
1
import { Outcome } from '@sentry/types' ;
2
2
import { SentryError } from '@sentry/utils' ;
3
3
4
- import { Event , Response , Status , Transports } from '../../../src' ;
4
+ import { Event , Response , Transports } from '../../../src' ;
5
5
6
6
const testDsn = 'https://[email protected] /42' ;
7
7
const storeUrl = 'https://sentry.io/api/42/store/?sentry_key=123&sentry_version=7' ;
@@ -61,7 +61,7 @@ describe('FetchTransport', () => {
61
61
62
62
const res = await transport . sendEvent ( eventPayload ) ;
63
63
64
- expect ( ( res as Response ) . status ) . toBe ( Status . Success ) ;
64
+ expect ( ( res as Response ) . status ) . toBe ( 'success' ) ;
65
65
expect ( fetch ) . toHaveBeenCalledWith ( storeUrl , {
66
66
body : JSON . stringify ( eventPayload ) ,
67
67
method : 'POST' ,
@@ -149,7 +149,7 @@ describe('FetchTransport', () => {
149
149
150
150
const res = await transport . sendEvent ( eventPayload ) ;
151
151
152
- expect ( ( res as Response ) . status ) . toBe ( Status . Success ) ;
152
+ expect ( ( res as Response ) . status ) . toBe ( 'success' ) ;
153
153
expect ( fetch ) . toHaveBeenCalledWith ( storeUrl , {
154
154
body : JSON . stringify ( eventPayload ) ,
155
155
headers : {
@@ -176,7 +176,7 @@ describe('FetchTransport', () => {
176
176
177
177
const res = await transport . sendEvent ( eventPayload ) ;
178
178
179
- expect ( ( res as Response ) . status ) . toBe ( Status . Success ) ;
179
+ expect ( ( res as Response ) . status ) . toBe ( 'success' ) ;
180
180
expect ( fetch ) . toHaveBeenCalledWith ( storeUrl , {
181
181
body : JSON . stringify ( eventPayload ) ,
182
182
credentials : 'include' ,
@@ -232,7 +232,7 @@ describe('FetchTransport', () => {
232
232
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers : new Headers ( ) } ) ) ;
233
233
234
234
const eventRes = await transport . sendEvent ( eventPayload ) ;
235
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
235
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
236
236
expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ;
237
237
} ) ;
238
238
@@ -275,7 +275,7 @@ describe('FetchTransport', () => {
275
275
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers : new Headers ( ) } ) ) ;
276
276
277
277
const transactionRes = await transport . sendEvent ( transactionPayload ) ;
278
- expect ( transactionRes . status ) . toBe ( Status . Success ) ;
278
+ expect ( transactionRes . status ) . toBe ( 'success' ) ;
279
279
expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ;
280
280
281
281
try {
@@ -290,7 +290,7 @@ describe('FetchTransport', () => {
290
290
}
291
291
292
292
const eventRes = await transport . sendEvent ( eventPayload ) ;
293
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
293
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
294
294
expect ( fetch ) . toHaveBeenCalledTimes ( 3 ) ;
295
295
} ) ;
296
296
@@ -357,11 +357,11 @@ describe('FetchTransport', () => {
357
357
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers : new Headers ( ) } ) ) ;
358
358
359
359
const eventRes = await transport . sendEvent ( eventPayload ) ;
360
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
360
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
361
361
expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ;
362
362
363
363
const transactionRes = await transport . sendEvent ( transactionPayload ) ;
364
- expect ( transactionRes . status ) . toBe ( Status . Success ) ;
364
+ expect ( transactionRes . status ) . toBe ( 'success' ) ;
365
365
expect ( fetch ) . toHaveBeenCalledTimes ( 3 ) ;
366
366
} ) ;
367
367
@@ -428,11 +428,11 @@ describe('FetchTransport', () => {
428
428
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers : new Headers ( ) } ) ) ;
429
429
430
430
const eventRes = await transport . sendEvent ( eventPayload ) ;
431
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
431
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
432
432
expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ;
433
433
434
434
const transactionRes = await transport . sendEvent ( transactionPayload ) ;
435
- expect ( transactionRes . status ) . toBe ( Status . Success ) ;
435
+ expect ( transactionRes . status ) . toBe ( 'success' ) ;
436
436
expect ( fetch ) . toHaveBeenCalledTimes ( 3 ) ;
437
437
} ) ;
438
438
@@ -460,7 +460,7 @@ describe('FetchTransport', () => {
460
460
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers } ) ) ;
461
461
462
462
let eventRes = await transport . sendEvent ( eventPayload ) ;
463
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
463
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
464
464
expect ( fetch ) . toHaveBeenCalled ( ) ;
465
465
466
466
try {
@@ -477,7 +477,7 @@ describe('FetchTransport', () => {
477
477
window . fetch . mockImplementation ( ( ) => Promise . resolve ( { status : 200 , headers : new Headers ( ) } ) ) ;
478
478
479
479
eventRes = await transport . sendEvent ( eventPayload ) ;
480
- expect ( eventRes . status ) . toBe ( Status . Success ) ;
480
+ expect ( eventRes . status ) . toBe ( 'success' ) ;
481
481
expect ( fetch ) . toHaveBeenCalledTimes ( 2 ) ;
482
482
} ) ;
483
483
0 commit comments