fbBatchedBridgeConfig 未设置

Ana*_*cão 5 jestjs react-native

yarn test在 React Native 移动应用程序上运行时出错。

 Test suite failed to run

    Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules

      2 | // import console = require('console');
      3 |
    > 4 | if (!NativeModules.DeviceMotionModule) {
        |      ^
      5 |   throw new Error('Native modules for sensors not available. Did react-native link run successfully?')
      6 | }
      7 |

      at invariant (node_modules/invariant/invariant.js:40:15)
      at Object.invariant (node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:162:3)
      at Object.require [as NativeModules] (node_modules/react-native/Libraries/react-native/react-native-implementation.js:322:12)
      at Object.NativeModules (src/NativeModules/SensorsIOS/sensors.js:4:6)
Run Code Online (Sandbox Code Playgroud)

我是开玩笑测试的新手。

我的项目中有一组用于 IOS 和 Android 的 costum 本机模块(不是 npm 模块)。