feat: demo mode + demo end-to-end tests
- built-in mock Gitea backend (src/core/demo): repositories, issues, comments, reactions, labels/milestones, pulls, files, diff, reviews, inline comments, releases, notifications, activity, Actions runs/jobs/logs/artifacts/workflows, repo settings, orgs/teams/packages/credentials/admin, and benign writes - session wires demoFetch for the demo instance; welcome screen 'Try the demo' - demo E2E (16 tests over the real endpoint layer) + UI render E2E; minimal reanimated jest mock; README demo-mode section
This commit is contained in:
1 parent
fbefa0d345
commit
1ee0f95b3f
10 files changed
+943
-5
No files matched your search
+18
-2
@@ -11,8 +11,24 @@ 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'));
|
||||
// Reanimated: minimal manual mock (the real package pulls native worklets).
|
||||
jest.mock('react-native-reanimated', () => {
|
||||
const { View } = require('react-native');
|
||||
return {
|
||||
__esModule: true,
|
||||
default: { View, createAnimatedComponent: (component: unknown) => component },
|
||||
useSharedValue: (value: unknown) => ({ value }),
|
||||
useAnimatedStyle: () => ({}),
|
||||
withTiming: (value: unknown) => value,
|
||||
withRepeat: (value: unknown) => value,
|
||||
withSequence: (...values: unknown[]) => values[values.length - 1],
|
||||
withDelay: (_delay: number, value: unknown) => value,
|
||||
cancelAnimation: () => undefined,
|
||||
runOnJS: (fn: unknown) => fn,
|
||||
runOnUI: (fn: unknown) => fn,
|
||||
Easing: { linear: () => 0, ease: () => 0, inOut: () => 0, out: () => 0, in: () => 0 },
|
||||
};
|
||||
});
|
||||
|
||||
// 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'));
|
||||
|
||||
Reference in new issue
Block a user