File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ describe('Hint', () => {
14
14
15
15
afterEach ( ( ) => {
16
16
jest . clearAllMocks ( ) ;
17
- // @ts -expect-error for testing
18
17
delete GLOBAL_OBJ . __SENTRY__ ;
19
18
} ) ;
20
19
Original file line number Diff line number Diff line change 7
7
spanToJSON ,
8
8
} from '@sentry/core' ;
9
9
import { SentrySpan } from '@sentry/core' ;
10
+ import { getSentryCarrier } from '../../src/carrier' ;
10
11
import {
11
12
addItemToEnvelope ,
12
13
createEnvelope ,
@@ -107,17 +108,18 @@ describe('envelope', () => {
107
108
{
108
109
name : 'with TextEncoder/Decoder polyfill' ,
109
110
before : ( ) => {
110
- GLOBAL_OBJ . __SENTRY__ = { } as InternalGlobal [ '__SENTRY__' ] ;
111
- GLOBAL_OBJ . __SENTRY__ . encodePolyfill = jest . fn < Uint8Array , [ string ] > ( ( input : string ) =>
111
+ GLOBAL_OBJ . __SENTRY__ = { } ;
112
+
113
+ getSentryCarrier ( GLOBAL_OBJ ) . encodePolyfill = jest . fn < Uint8Array , [ string ] > ( ( input : string ) =>
112
114
new TextEncoder ( ) . encode ( input ) ,
113
115
) ;
114
- GLOBAL_OBJ . __SENTRY__ . decodePolyfill = jest . fn < string , [ Uint8Array ] > ( ( input : Uint8Array ) =>
116
+ getSentryCarrier ( GLOBAL_OBJ ) . decodePolyfill = jest . fn < string , [ Uint8Array ] > ( ( input : Uint8Array ) =>
115
117
new TextDecoder ( ) . decode ( input ) ,
116
118
) ;
117
119
} ,
118
120
after : ( ) => {
119
- expect ( GLOBAL_OBJ . __SENTRY__ . encodePolyfill ) . toHaveBeenCalled ( ) ;
120
- expect ( GLOBAL_OBJ . __SENTRY__ . decodePolyfill ) . toHaveBeenCalled ( ) ;
121
+ expect ( getSentryCarrier ( GLOBAL_OBJ ) . encodePolyfill ) . toHaveBeenCalled ( ) ;
122
+ expect ( getSentryCarrier ( GLOBAL_OBJ ) . decodePolyfill ) . toHaveBeenCalled ( ) ;
121
123
} ,
122
124
} ,
123
125
{
You can’t perform that action at this time.
0 commit comments