- 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)
21 lines
776 B
TypeScript
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',
|
|
},
|
|
});
|