Files
lnreader/test/mocks/nativeModules.js
T
Rajarshee Chatterjee 74808f086e feat: Replace Legacy Media Controls with Nitro-Powered Playback (#1896)
* feat: Replace Legacy Media Controls with Nitro-Powered Playback

* feat: Add TTS Engine Selection

* chore: Remove User-Facing Error Reporting

* refactor: Combine `Tts` and `TtsSession` Imports from `nitro-tts` Module

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-24 23:42:17 +05:30

54 lines
1.3 KiB
JavaScript

// require('react-native-gesture-handler/jestSetup');
// require('react-native-reanimated').setUpTests();
jest.mock('@modules/native-file', () => ({
__esModule: true,
default: {
writeFile: jest.fn(),
readFile: jest.fn(() => ''),
copyFile: jest.fn(),
moveFile: jest.fn(),
exists: jest.fn(() => true),
mkdir: jest.fn(),
unlink: jest.fn(),
readDir: jest.fn(() => []),
downloadFile: jest.fn().mockResolvedValue(),
getConstants: jest.fn(() => ({
ExternalDirectoryPath: '/mock/external',
ExternalCachesDirectoryPath: '/mock/caches',
})),
},
}));
const mockEpubNovel = {
name: 'Mock Novel',
cover: null,
summary: null,
author: null,
artist: null,
chapters: [],
cssPaths: [],
imagePaths: [],
};
global.mockEpubNovel = mockEpubNovel;
jest.mock('@modules/native-volume-button-listener', () => ({
__esModule: true,
default: {
addListener: jest.fn(() => ({ remove: jest.fn() })),
removeListeners: jest.fn(),
setActive: jest.fn(),
},
}));
jest.mock('@modules/native-zip-archive', () => ({
__esModule: true,
default: {
zip: jest.fn().mockResolvedValue(),
unzip: jest.fn().mockResolvedValue(),
remoteUnzip: jest.fn().mockResolvedValue(),
remoteZip: jest.fn().mockResolvedValue(''),
},
}));