@kiwa-lab/expo
v2.1.0
Published
Expo SDK mock harness for kiwa — Expo Router / SecureStore / Notifications / FileSystem / Camera を統一 interface で invoke する in-process mock。 実 Expo runtime 不要で React Native + Expo app の SDK 連携経路 (routing / secure storage / push / file I/O / camera capture)
Downloads
22
Maintainers
Readme
@kiwa-lab/expo
Expo SDK mock harness for kiwa — Expo Router / SecureStore / Notifications / FileSystem / Camera を統一 interface で in-process から叩ける test infra。
Installation
pnpm add -D @kiwa-lab/expo
# or
npm install -D @kiwa-lab/expo
# or
yarn add -D @kiwa-lab/expoSupported providers
| SDK | Status | Primary API |
|---|---|---|
| Expo Router | ✅ Ready | mockExpoRouter |
| SecureStore | ✅ Ready | mockSecureStore |
| Notifications | ✅ Ready | dispatchNotification |
| FileSystem | ✅ Ready | mockFileSystem |
| Camera | ✅ Ready | mockCamera |
Quick start
import { describe, expect, it } from 'vitest';
import {
createExpoTestEnv,
mockExpoRouter,
mockSecureStore,
dispatchNotification,
} from '@kiwa-lab/expo';
describe('expo push flow', () => {
it('secure token 保存 + notification tap で /orders へ遷移', async () => {
const env = createExpoTestEnv();
const store = mockSecureStore({});
const router = mockExpoRouter({ initial: '/' });
await store.setItemAsync('sessionToken', 's-1');
dispatchNotification({ title: 'Order', body: 'ready', data: { path: '/orders' } });
router.push('/orders');
expect(router.current).toBe('/orders');
expect(await store.getItemAsync('sessionToken')).toBe('s-1');
});
});API reference
createExpoTestEnv(): ExpoTestEnv— Expo runtime mock (app config + manifest)mockExpoRouter({ initial }): ExpoRouterMock— push/back/replace + navigation stackmockSecureStore(initial): SecureStoreMock— setItemAsync / getItemAsync / deleteItemAsyncdispatchNotification(payload): NotificationDispatchResult— 通知経路発火 + scheduled tracemockFileSystem(options): FileSystemMock— read/write/exists/deletemockCamera(options): CameraMock— takePicture / recordVideo / permission trace
Test integration
vitest + /kiwa-expo skill で real Expo Go / EAS build 不要、 SDK 依存 flow を全 in-process で verify。
License
UNLICENSED — see github.com/cardene777/kiwa.
