- Expo SDK 57 / React Native 0.86 / TypeScript strict - ESLint (expo config), Prettier, jest-expo setup - app identifiers org.giteanative.app, deep-link scheme giteanative - original git-branch app icons generated from scratch (scripts/generate-icons.py) - MIT licence for the Gitea Native contributors (unofficial project)
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
/**
|
|
* Jest setup for Gitea Native.
|
|
*
|
|
* Native modules that cannot run in the Jest (Node) environment are mocked here.
|
|
* Test-specific mocks (e.g. expo-secure-store) live next to the tests that need them
|
|
* unless they are required globally.
|
|
*/
|
|
|
|
// AsyncStorage: official in-memory mock provided by the package.
|
|
jest.mock('@react-native-async-storage/async-storage', () =>
|
|
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
|
|
);
|
|
|
|
// Reanimated: official mock (worklets are not available in Jest).
|
|
jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock'));
|
|
|
|
// Safe area: official mock so SafeAreaView/useSafeAreaInsets work in tests.
|
|
jest.mock('react-native-safe-area-context', () => require('react-native-safe-area-context/jest/mock'));
|
|
|
|
// Haptics: no native module in Jest.
|
|
jest.mock('expo-haptics', () => ({
|
|
selectionAsync: jest.fn(async () => undefined),
|
|
impactAsync: jest.fn(async () => undefined),
|
|
notificationAsync: jest.fn(async () => undefined),
|
|
}));
|