fix: mock netinfo in the vitest setup so the auth-store suite loads

This commit is contained in:
Linus Rath
2026-08-29 17:30:59 +02:00
parent eaa8249e76
commit b84d4d8e9e
+11
View File
@@ -72,3 +72,14 @@ vi.mock('expo-web-browser', () => ({
openAuthSessionAsync: vi.fn(async () => ({ type: 'cancel' as const })), openAuthSessionAsync: vi.fn(async () => ({ type: 'cancel' as const })),
maybeCompleteAuthSession: vi.fn(), 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 })),
},
}));