Skip to content

Commit a6b1f61

Browse files
improvements
1 parent 95b67f5 commit a6b1f61

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/event_processor/event_processor_factory.react_native.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ vi.mock('../utils/cache/store', () => {
4747
vi.mock('@react-native-community/netinfo', () => {
4848
return { NetInfoState: {}, addEventListener: vi.fn() };
4949
});
50-
let isNetInfoAvailable = true;
5150
let isAsyncStorageAvailable = true;
5251

5352
await vi.hoisted(async () => {
@@ -60,15 +59,10 @@ async function mockRequireNetInfo() {
6059

6160
M._load_original = M._load;
6261
M._load = (uri: string, parent: string) => {
63-
if (uri === '@react-native-community/netinfo') {
64-
if (isNetInfoAvailable) return {};
65-
throw new Error("Module not found: @react-native-community/netinfo");
66-
}
6762
if (uri === '@react-native-async-storage/async-storage') {
6863
if (isAsyncStorageAvailable) return {};
6964
throw new Error("Module not found: @react-native-async-storage/async-storage");
7065
}
71-
7266
return M._load_original(uri, parent);
7367
};
7468
}
@@ -87,7 +81,6 @@ describe('createForwardingEventProcessor', () => {
8781

8882
beforeEach(() => {
8983
mockGetForwardingEventProcessor.mockClear();
90-
isNetInfoAvailable = false;
9184
});
9285

9386
it('returns forwarding event processor by calling getForwardingEventProcessor with the provided dispatcher', () => {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@
147147
"webpack": "^5.74.0"
148148
},
149149
"peerDependencies": {
150-
"@react-native-async-storage/async-storage": ">=1.2.0 <3.0.0",
151-
"@react-native-community/netinfo": ">=10.0.0 <12.0.0",
150+
"@react-native-async-storage/async-storage": ">=1.0.0 <3.0.0",
151+
"@react-native-community/netinfo": ">=5.0.0 <12.0.0",
152152
"fast-text-encoding": "^1.0.6",
153153
"react-native-get-random-values": "^1.11.0",
154154
"ua-parser-js": "^1.0.38"

0 commit comments

Comments
 (0)