@@ -13,7 +13,7 @@ getConfig('coreComponents').forEach(component => {
1313} ) ;
1414
1515// Un-mock ReactNative so we can hide annoying `console.warn`s
16- jest . unmock ( 'ReactNative' ) ;
16+ jest . unmock ( 'react-native/Libraries/Renderer/shims/ ReactNative' ) ;
1717
1818// Mock the components we want mocked
1919getConfig ( 'coreComponents' ) . forEach ( component => {
@@ -23,21 +23,23 @@ getConfig('coreComponents').forEach(component => {
2323} ) ;
2424
2525// Mock the Picker one-off because it's kinda weird
26- jest . doMock ( 'Picker' , ( ) => {
26+ jest . doMock ( 'react-native/Libraries/Components/Picker/ Picker' , ( ) => {
2727 const React = jest . requireActual ( 'react' ) ;
28- const Picker = mockComponent ( 'Picker' ) ;
28+ const Picker = mockComponent ( 'react-native/Libraries/Components/Picker/ Picker' ) ;
2929 Picker . Item = ( { children, ...props } ) => React . createElement ( 'Picker.Item' , props , children ) ;
3030 return Picker ;
3131} ) ;
3232
3333// Re-mock ReactNative with native methods mocked
34- jest . mock ( 'NativeAnimatedHelper' ) . doMock ( 'ReactNative' , ( ) => {
35- const ReactNative = jest . requireActual ( 'ReactNative' ) ;
36- const NativeMethodsMixin =
37- ReactNative . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED . NativeMethodsMixin ;
34+ jest
35+ . mock ( 'react-native/Libraries/Animated/src/NativeAnimatedHelper' )
36+ . doMock ( 'react-native/Libraries/Renderer/shims/ReactNative' , ( ) => {
37+ const ReactNative = jest . requireActual ( 'react-native/Libraries/Renderer/shims/ReactNative' ) ;
38+ const NativeMethodsMixin =
39+ ReactNative . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED . NativeMethodsMixin ;
3840
39- Object . assign ( NativeMethodsMixin , mockNativeMethods ) ;
40- Object . assign ( ReactNative . NativeComponent . prototype , mockNativeMethods ) ;
41+ Object . assign ( NativeMethodsMixin , mockNativeMethods ) ;
42+ Object . assign ( ReactNative . NativeComponent . prototype , mockNativeMethods ) ;
4143
42- return ReactNative ;
43- } ) ;
44+ return ReactNative ;
45+ } ) ;
0 commit comments