mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 08:06:36 +00:00
fix: mock netinfo in the vitest setup so the auth-store suite loads
This commit is contained in:
@@ -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 })),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user