Warning in Jest: 'Native module not found/exported - are you sure its linked properly?'

Viewed 919

I have a react-native expo bare workflow app where I'm seeing a warning in my console only when running tests in jest the packages in question work when used in my app (tested unimodules works via using the Constants in there), and I've re-followed the instructions to set them up multiple times: https://docs.expo.io/bare/installing-unimodules/

These warnings don't prevent my app running or my tests, but they clog up the terminal as they repeat for every set of tests making it a struggle to read. (I'm aware I can run jest with the --silent flag but this will obviously hide all the other output like actual errors e.g. wrap in act(() => { }) errors)

The warnings:

  console.warn
    The "UMNativeModulesProxy" native module is not exported through NativeModules; verify that @unimodules/react-native-adapter's native code is linked properly

      at Object.<anonymous> (node_modules/@unimodules/react-native-adapter/src/NativeModulesProxy.native.ts:41:11)
      at Object.<anonymous> (node_modules/@unimodules/react-native-adapter/src/index.ts:2:1)

 console.warn
    No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?

      at Object.<anonymous> (node_modules/expo-constants/src/Constants.ts:25:11)
      at Object.<anonymous> (node_modules/expo-asset/src/PlatformUtils.ts:3:1)
0 Answers
Related