Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
106 lines
2.6 KiB
JavaScript
106 lines
2.6 KiB
JavaScript
import '@testing-library/jest-native/extend-expect';
|
|
|
|
// Mock AsyncStorage
|
|
jest.mock('@react-native-async-storage/async-storage', () =>
|
|
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
|
|
);
|
|
|
|
// Mock expo-router
|
|
jest.mock('expo-router', () => ({
|
|
useRouter: () => ({
|
|
push: jest.fn(),
|
|
replace: jest.fn(),
|
|
back: jest.fn(),
|
|
}),
|
|
useLocalSearchParams: () => ({}),
|
|
useSegments: () => [],
|
|
usePathname: () => '/',
|
|
Link: 'Link',
|
|
Stack: {
|
|
Screen: 'Screen',
|
|
},
|
|
}));
|
|
|
|
// Mock expo-image
|
|
jest.mock('expo-image', () => ({
|
|
Image: 'Image',
|
|
ImageSource: {},
|
|
}));
|
|
|
|
// Mock expo-constants
|
|
jest.mock('expo-constants', () => ({
|
|
__esModule: true,
|
|
default: {
|
|
expoConfig: {
|
|
extra: {},
|
|
},
|
|
easConfig: {},
|
|
},
|
|
}));
|
|
|
|
// Mock expo-notifications
|
|
jest.mock('expo-notifications', () => ({
|
|
setNotificationHandler: jest.fn(),
|
|
getPermissionsAsync: jest.fn(() => Promise.resolve({ status: 'granted' })),
|
|
requestPermissionsAsync: jest.fn(() => Promise.resolve({ status: 'granted' })),
|
|
getExpoPushTokenAsync: jest.fn(() => Promise.resolve({ data: 'ExponentPushToken[test]' })),
|
|
setNotificationChannelAsync: jest.fn(() => Promise.resolve()),
|
|
addNotificationReceivedListener: jest.fn(() => ({ remove: jest.fn() })),
|
|
addNotificationResponseReceivedListener: jest.fn(() => ({ remove: jest.fn() })),
|
|
cancelAllScheduledNotificationsAsync: jest.fn(() => Promise.resolve()),
|
|
setBadgeCountAsync: jest.fn(() => Promise.resolve()),
|
|
AndroidImportance: {
|
|
MAX: 'max',
|
|
},
|
|
}));
|
|
|
|
// Mock expo-device
|
|
jest.mock('expo-device', () => ({
|
|
isDevice: false,
|
|
deviceName: 'Test Device',
|
|
brand: 'Test',
|
|
modelName: 'Device',
|
|
}));
|
|
|
|
// Mock expo-clipboard
|
|
jest.mock('expo-clipboard', () => ({
|
|
setStringAsync: jest.fn(() => Promise.resolve()),
|
|
}));
|
|
|
|
// Mock expo-video
|
|
jest.mock('expo-video', () => ({
|
|
VideoView: 'VideoView',
|
|
useVideoPlayer: jest.fn(() => ({
|
|
play: jest.fn(),
|
|
pause: jest.fn(),
|
|
loop: false,
|
|
muted: false,
|
|
})),
|
|
}));
|
|
|
|
// Mock expo-image-picker
|
|
jest.mock('expo-image-picker', () => ({
|
|
requestMediaLibraryPermissionsAsync: jest.fn(() =>
|
|
Promise.resolve({ status: 'granted' })
|
|
),
|
|
launchImageLibraryAsync: jest.fn(() =>
|
|
Promise.resolve({
|
|
canceled: false,
|
|
assets: [{ uri: 'file://test-image.jpg' }],
|
|
})
|
|
),
|
|
}));
|
|
|
|
// Mock @react-native-community/netinfo
|
|
jest.mock('@react-native-community/netinfo', () => ({
|
|
fetch: jest.fn(() => Promise.resolve({ isConnected: true })),
|
|
addEventListener: jest.fn(() => jest.fn()),
|
|
}));
|
|
|
|
// Silence console warnings in tests
|
|
global.console = {
|
|
...console,
|
|
warn: jest.fn(),
|
|
error: jest.fn(),
|
|
};
|