deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native
MIT License
917 stars 235 forks source link

jest: TypeError: UIManager.measure is not a function #107

Closed femiveys closed 7 years ago

femiveys commented 7 years ago

On version 0.2.6 I get problems when running jest tests.

I get TypeError: UIManager.measure is not a function at Component.measure (.../node_modules/react-native/Libraries/Renderer/src/renderers/native/NativeMethodsMixin.js:86:11)

I am on react-native 0.42.3

When doing the same test on version 0.2.5 there is no problem

nihgwu commented 7 years ago

you have to mock UIManager, in v0.2.5 we use onLayout instead of measure, see https://github.com/deanmcpherson/react-native-sortable-listview/blob/master/__tests__/index.test.js#L8

femiveys commented 7 years ago

Thanks, this works