File tree Expand file tree Collapse file tree
packages/browser-sdk/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ const logger = {
1010} ;
1111
1212let documentDescriptor : PropertyDescriptor | undefined ;
13- let cryptoDescriptor : PropertyDescriptor | undefined ;
1413
1514function hideDocumentGlobal ( ) {
1615 documentDescriptor = Object . getOwnPropertyDescriptor ( globalThis , "document" ) ;
@@ -27,32 +26,15 @@ function restoreDocumentGlobal() {
2726 }
2827}
2928
30- function hideWebCryptoGlobal ( ) {
31- cryptoDescriptor = Object . getOwnPropertyDescriptor ( globalThis , "crypto" ) ;
32- Object . defineProperty ( globalThis , "crypto" , {
33- configurable : true ,
34- value : { } ,
35- } ) ;
36- }
37-
38- function restoreWebCryptoGlobal ( ) {
39- if ( cryptoDescriptor ) {
40- Object . defineProperty ( globalThis , "crypto" , cryptoDescriptor ) ;
41- cryptoDescriptor = undefined ;
42- }
43- }
44-
4529afterEach ( ( ) => {
4630 restoreDocumentGlobal ( ) ;
47- restoreWebCryptoGlobal ( ) ;
4831 vi . restoreAllMocks ( ) ;
4932 vi . resetModules ( ) ;
5033} ) ;
5134
5235describe ( "React Native runtime" , ( ) => {
5336 test ( "initializes pubsub without document when an SSE transport is provided" , async ( ) => {
5437 hideDocumentGlobal ( ) ;
55- hideWebCryptoGlobal ( ) ;
5638 vi . resetModules ( ) ;
5739
5840 const closeChannel = vi . fn ( ) ;
You can’t perform that action at this time.
0 commit comments