Skip to content

Commit 372a1bf

Browse files
committed
up
1 parent 5daa4e0 commit 372a1bf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/event_processor/batch_event_processor.react_native.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const mockNetInfo = vi.hoisted(() => {
3939
return netInfo;
4040
});
4141

42-
vi.mock('@react-native-community/netinfo', () => {
42+
vi.mock('../utils/import.react_native/@react-native-community/netinfo', () => {
4343
return {
4444
addEventListener: mockNetInfo.addEventListener.bind(mockNetInfo),
4545
};

lib/event_processor/event_processor_factory.react_native.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ describe('createBatchEventProcessor', () => {
125125

126126
it('returns an instance of BatchEventProcessor if netinfo cannot be required', async () => {
127127
isNetInfoAvailable = false;
128-
const processor = createBatchEventProcessor({});;
128+
const processor = createBatchEventProcessor({});
129+
expect(Object.is(processor, mockGetBatchEventProcessor.mock.results[0].value)).toBe(true);
129130
expect(mockGetBatchEventProcessor.mock.calls[0][1]).toBe(BatchEventProcessor);
130131
});
131132

lib/utils/import.react_native/@react-native-community/netinfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const requireNetInfo = () => {
3030
}
3131
}
3232

33-
export const isAvailable = () => requireNetInfo() !== undefined;
33+
export const isAvailable = (): boolean => requireNetInfo() !== undefined;
3434

3535
const netinfo = requireNetInfo();
3636
addEventListener = netinfo?.addEventListener;

0 commit comments

Comments
 (0)