learning_ai_notes/mobile/vitest.config.ts
saravanakumardb1 5a0175fa66 feat(mobile): add Block H — Vitest RN mock aliases + component smoke tests
- Create __mocks__/ with react-native, expo-router, expo-constants, expo-status-bar, react-native-mmkv, @testing-library/react-native
- Update vitest.config.ts with resolve aliases for all native modules
- Add AuthScreen smoke test (3 tests)
- Add HomeScreen smoke test (2 tests)
- Add @types/react-test-renderer dev dependency
- Total: 32 passing tests (27 store + 5 component)
2026-03-31 00:42:49 -07:00

21 lines
776 B
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
resolve: {
alias: {
'react-native': path.resolve(__dirname, '__mocks__/react-native.ts'),
'react-native-mmkv': path.resolve(__dirname, '__mocks__/react-native-mmkv.ts'),
'expo-router': path.resolve(__dirname, '__mocks__/expo-router.ts'),
'expo-constants': path.resolve(__dirname, '__mocks__/expo-constants.ts'),
'expo-status-bar': path.resolve(__dirname, '__mocks__/expo-status-bar.ts'),
'@testing-library/react-native': path.resolve(__dirname, '__mocks__/@testing-library/react-native.tsx'),
},
},
test: {
passWithNoTests: true,
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
environment: 'node',
},
});