@@ -47,8 +47,6 @@ vi.mock('../utils/cache/store', () => {
4747vi . mock ( '@react-native-community/netinfo' ,  ( )  =>  { 
4848  return  {  NetInfoState : { } ,  addEventListener : vi . fn ( )  } ; 
4949} ) ; 
50- 
51- let  isNetInfoAvailable  =  false ; 
5250let  isAsyncStorageAvailable  =  true ; 
5351
5452await  vi . hoisted ( async  ( )  =>  { 
@@ -61,36 +59,28 @@ async function mockRequireNetInfo() {
6159
6260  M . _load_original  =  M . _load ; 
6361  M . _load  =  ( uri : string ,  parent : string )  =>  { 
64-     if  ( uri  ===  '@react-native-community/netinfo' )  { 
65-       if  ( isNetInfoAvailable )  return  { } ; 
66-       throw  new  Error ( "Module not found: @react-native-community/netinfo" ) ; 
67-     } 
6862    if  ( uri  ===  '@react-native-async-storage/async-storage' )  { 
6963      if  ( isAsyncStorageAvailable )  return  { } ; 
7064      throw  new  Error ( "Module not found: @react-native-async-storage/async-storage" ) ; 
7165    } 
72- 
7366    return  M . _load_original ( uri ,  parent ) ; 
7467  } ; 
7568} 
7669
7770import  {  createForwardingEventProcessor ,  createBatchEventProcessor  }  from  './event_processor_factory.react_native' ; 
7871import  {  getForwardingEventProcessor  }  from  './forwarding_event_processor' ; 
7972import  defaultEventDispatcher  from  './event_dispatcher/default_dispatcher.browser' ; 
80- import  {  EVENT_STORE_PREFIX ,  extractEventProcessor ,  FAILED_EVENT_RETRY_INTERVAL ,   getPrefixEventStore  }  from  './event_processor_factory' ; 
73+ import  {  EVENT_STORE_PREFIX ,  extractEventProcessor ,  FAILED_EVENT_RETRY_INTERVAL  }  from  './event_processor_factory' ; 
8174import  {  getOpaqueBatchEventProcessor  }  from  './event_processor_factory' ; 
8275import  {  AsyncStore ,  AsyncPrefixStore ,  SyncStore ,  SyncPrefixStore  }  from  '../utils/cache/store' ; 
8376import  {  AsyncStorageCache  }  from  '../utils/cache/async_storage_cache.react_native' ; 
84- import  {  ReactNativeNetInfoEventProcessor  }  from  './batch_event_processor.react_native' ; 
85- import  {  BatchEventProcessor  }  from  './batch_event_processor' ; 
8677import  {  MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE  }  from  '../utils/import.react_native/@react-native-async-storage/async-storage' ; 
8778
8879describe ( 'createForwardingEventProcessor' ,  ( )  =>  { 
8980  const  mockGetForwardingEventProcessor  =  vi . mocked ( getForwardingEventProcessor ) ; 
9081
9182  beforeEach ( ( )  =>  { 
9283    mockGetForwardingEventProcessor . mockClear ( ) ; 
93-     isNetInfoAvailable  =  false ; 
9484  } ) ; 
9585
9686  it ( 'returns forwarding event processor by calling getForwardingEventProcessor with the provided dispatcher' ,  ( )  =>  { 
@@ -119,27 +109,12 @@ describe('createBatchEventProcessor', () => {
119109  const  MockAsyncPrefixStore  =  vi . mocked ( AsyncPrefixStore ) ; 
120110
121111  beforeEach ( ( )  =>  { 
122-     isNetInfoAvailable  =  false ; 
123112    mockGetOpaqueBatchEventProcessor . mockClear ( ) ; 
124113    MockAsyncStorageCache . mockClear ( ) ; 
125114    MockSyncPrefixStore . mockClear ( ) ; 
126115    MockAsyncPrefixStore . mockClear ( ) ; 
127116  } ) ; 
128117
129-   it ( 'returns an instance of ReacNativeNetInfoEventProcessor if netinfo can be required' ,  async  ( )  =>  { 
130-     isNetInfoAvailable  =  true ; 
131-     const  processor  =  createBatchEventProcessor ( { } ) ; 
132-     expect ( Object . is ( processor ,  mockGetOpaqueBatchEventProcessor . mock . results [ 0 ] . value ) ) . toBe ( true ) ; 
133-     expect ( mockGetOpaqueBatchEventProcessor . mock . calls [ 0 ] [ 1 ] ) . toBe ( ReactNativeNetInfoEventProcessor ) ; 
134-   } ) ; 
135- 
136-   it ( 'returns an instance of BatchEventProcessor if netinfo cannot be required' ,  async  ( )  =>  { 
137-     isNetInfoAvailable  =  false ; 
138-     const  processor  =  createBatchEventProcessor ( { } ) ; 
139-     expect ( Object . is ( processor ,  mockGetOpaqueBatchEventProcessor . mock . results [ 0 ] . value ) ) . toBe ( true ) ; 
140-     expect ( mockGetOpaqueBatchEventProcessor . mock . calls [ 0 ] [ 1 ] ) . toBe ( BatchEventProcessor ) ; 
141-   } ) ; 
142- 
143118  it ( 'uses AsyncStorageCache and AsyncPrefixStore to create eventStore if no eventStore is provided' ,  ( )  =>  { 
144119    const  processor  =  createBatchEventProcessor ( { } ) ; 
145120
0 commit comments