Files
App/jest/setup/nitro-ota.ts
Ritesh Shukla 4d560be350 Nitro OTA Package (#560)
Adds internal over-the-air update support

Powered by `react-native-nitro-modules`, this OTA functionality is faster than the previous implementation, and won't slow down the UI when updates are being applied since updates occur off the main thread
2025-10-21 14:28:53 -05:00

22 lines
638 B
TypeScript

// Mock for react-native-nitro-ota
jest.mock('react-native-nitro-ota', () => ({
githubOTA: jest.fn(() => ({
downloadUrl: 'mock://download.url',
versionUrl: 'mock://version.url',
})),
OTAUpdateManager: jest.fn().mockImplementation(() => ({
checkForUpdates: jest.fn().mockResolvedValue(null),
downloadUpdate: jest.fn().mockResolvedValue(undefined),
})),
}))
// Update the existing nitro-modules mock to include createHybridObject
jest.mock('react-native-nitro-modules', () => ({
NitroModules: {
createModule: jest.fn(),
install: jest.fn(),
createHybridObject: jest.fn(() => ({})),
},
createNitroModule: jest.fn(),
}))