From b84d4d8e9ea52185e08ddb2a4d0216f0ba6c789a Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 29 Aug 2026 17:30:59 +0200 Subject: [PATCH] fix: mock netinfo in the vitest setup so the auth-store suite loads --- src/test-setup.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test-setup.ts b/src/test-setup.ts index ebc4847e..20840685 100644 --- a/src/test-setup.ts +++ b/src/test-setup.ts @@ -72,3 +72,14 @@ vi.mock('expo-web-browser', () => ({ openAuthSessionAsync: vi.fn(async () => ({ type: 'cancel' as const })), maybeCompleteAuthSession: vi.fn(), })); + +// @react-native-community/netinfo ships Flow-typed source that rolldown +// cannot parse. The outbox/network stores import it at module load, so any +// suite that reaches them (auth-store -> email-store -> outbox-store) needs +// this mock. Reports "online" by default. +vi.mock('@react-native-community/netinfo', () => ({ + default: { + addEventListener: vi.fn(() => () => undefined), + fetch: vi.fn(async () => ({ isConnected: true, isInternetReachable: true })), + }, +}));