invertase/react-native-firebase-starter

[help-wanted] Add tests example

Open

#21 创建于 2018年4月13日

在 GitHub 查看
 (2 评论) (6 反应) (0 负责人)JavaScript (1,174 star) (346 fork)batch import
enhancementhelp wanted

描述

After following the getting started instructions, running npm test results in an error:

 FAIL  ./App.test.js
  ● Test suite failed to run

    RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.

     See http://invertase.link/ios for the ios setup guide.

       9 | } from 'react-native'
      10 |
    > 11 | import firebase from 'react-native-firebase'
      12 |
      13 | export default class App extends React.Component {
      14 |   constructor () {
      Error: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects `Podfile` and have run `pod install`.

This has already been reported in the react-native-firebase repo and it appears this is expected behavior - according to that thread RNFirebase needs to be mocked out for the tests to work.

Assuming that's all correct, I would propose adding a basic mock for RNFirebase to this starter project and enabling it by default.

贡献者指南