import { PlatformOSType } from 'react-native'; export const mockDimensions = (mockWidth: number, mockHeight: number): void => { jest.resetModules(); jest.mock('react-native/Libraries/Utilities/Dimensions', () => ({ get: jest.fn().mockReturnValue({ width: mockWidth, height: mockHeight }), })); }; export const mockPlatform = (mockOS: PlatformOSType): void => { jest.resetModules(); jest.mock('react-native/Libraries/Utilities/Platform', () => ({ OS: mockOS, select: () => null, })); }; export const mockPixelRatio = (mockScale: number): void => { jest.resetModules(); jest.mock('react-native/Libraries/Utilities/PixelRatio', () => ({ get: jest.fn().mockReturnValue(mockScale), })); };