mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
d363b1f2e2
Reviewed By: javache Differential Revision: D3229435 fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
19 lines
485 B
JavaScript
19 lines
485 B
JavaScript
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const PixelRatio = {
|
|
get: jest.fn().mockReturnValue(2),
|
|
getFontScale: jest.fn(() => PixelRatio.get()),
|
|
getPixelSizeForLayoutSize: jest.fn(layoutSize => Math.round(layoutSize * PixelRatio.get())),
|
|
roundToNearestPixel: jest.fn(layoutSize => {
|
|
const ratio = PixelRatio.get();
|
|
return Math.round(layoutSize * ratio) / ratio;
|
|
}),
|
|
startDetecting: jest.fn(),
|
|
};
|
|
|
|
module.exports = PixelRatio;
|